Good news I think. I parked this issue a while back but stumbled on a successful search result whilst investigating removing the removable bit from volumes... all credit goes to
Helge Klein
The enumerated data is recreated on reboot, so a script (batch) is needed to write the registry entry.
I just tested by:
using regedit to navigate to the (virtual) volume's Key (use devmgmt.msc and properties on the device, populate the volume to identify and capacity and confirm you have the right volume if you have several... Think I'll modify the "friendly name" too...) captured from the device instance path, ie
identify volume
get dev.ID
Find in reg, ie
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SCSI\Disk&Ven_Msft&Prod_Virtual_Disk\2&1f4adffe&0&000002
Get permission! (Tip: NirSoft
RegOwnership)
Change Capabilities to 2 (decimal)
NB if you get a permission error navigate away from and back to the key, to refresh.
//from inc/api/cfgmgr32.h (WINDDK)
#define CM_DEVCAP_LOCKSUPPORTED (0x00000001)
#define CM_DEVCAP_EJECTSUPPORTED (0x00000002)
#define CM_DEVCAP_REMOVABLE (0x00000004)
#define CM_DEVCAP_DOCKDEVICE (0x00000008)
#define CM_DEVCAP_UNIQUEID (0x00000010)
#define CM_DEVCAP_SILENTINSTALL (0x00000020)
#define CM_DEVCAP_RAWDEVICEOK (0x00000040)
#define CM_DEVCAP_SURPRISEREMOVALOK (0x00000080)
#define CM_DEVCAP_HARDWAREDISABLED (0x00000100) (default)
#define CM_DEVCAP_NONDYNAMIC (0x00000200)
The change is noticeable straight away..
I'm gonna do some more testing with a dummy volume, to ensure normal detach (using diskmgmt, for example) is not hindered....