Autosharing app for USB devices on Windows 10?

Looking at the subjects of the networking forum, I thought this would be a better place. Admins, if this is not the case please let me know.

I’m looking for an app that will automatically share any mass storage device that gets plugged into the PC. So if I plug in a USB stick, an external HDD or a USB card reader with an SD card, they would automatically be shared on the network with access rights set up in the app.

There was such an app for Windows 7 - SharePlugger, by a Dutch company - but this gets blocked by Windows 10. The company is no longer active but it was going until 2018 I believe, making NAS apps and small Webservers and such.

I have not been able to find such a thing for Windows 10.

Can anyone help, or know of a way to script this for instance? I have to hotswap HDDs in a USB x5 case regularly, and each time I have to RD into my small home server to set up sharing of these drives manually. It’s a royal PITA. Automating this would really save me time.

One method I’m aware of is to use a PowerShell script. It’s a sample script that you may change to fit your needs:

# Set up sharing for any newly added mass storage devices
$wmi = Get-WmiObject -Class Win32_VolumeChangeEvent
Register-WmiEvent -InputObject $wmi -Action {
    $driveLetter = $_.DriveName.Substring(0, 2)
    $shareName = "Share_" + $driveLetter.Replace(':', '$')
    $path = $driveLetter + "\"
    $description = "Shared drive " + $driveLetter
    $acl = Get-Acl $path
    $acl.SetAccessRuleProtection($false, $false)
    $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Everyone", "FullControl", "Allow")
    $acl.AddAccessRule($rule)
    $obj = New-SmbShare -Name $shareName -Path $path -Description $description -FullAccess "Everyone"
    $obj = $null
    Set-Acl $path $acl
}

Just save the script as “auto share.ps1” in a file with a.ps1 extension. The script may then be executed using PowerShell. If you execute PowerShell as an administrator, you may not have adequate rights to establish shares.

i dont know if it will help you but still

and also there is another way is to share USB devices across the network, use a third-party solution such as USB Network Gate or FlexiHub. These technologies enable you to access USB devices from remote PCs rather than physically plugging them into your server. Some tools, however, are not free, and you may need to obtain a licence to utilise them.

Thanks for the reply! The USB Network Gate app seems what I need, but at 160 USD it’s way too expensive for home use.

I’m not that good at scripting, so I’ll need some time to experiment with your template, but it seems this would do the trick. But would it do this always in the background or would you need to manually run it every time a device gets plugged in?

UPDATE: unfortunately, I cannot get the script to work. Nothing happens. It runs without error code. No errors in the logs either. It’s a bit beyond my Powershell knowledge.

Anyone have any other ideas?