First, a caveat. Unfortunately, this method affects the entire machine as a whole. This means the restriction will apply both to a regular user and to an administrator. Moreover, for the restriction to take effect, the machine must be fully rebooted - simply logging off and back on is not enough.
It should also be noted that this method was tested on Windows XP. How it behaves on Vista or Windows 7 is not yet known (but this will be tested and noted here).
So, the following changes need to be made in the Windows registry.
Blocking the CD-ROM.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom
Set the "Start" key to the value "4"
Allowing the CD-ROM again.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom
Set the "Start" key to the value "1"
Blocking USB flash drives.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
Set the "Start" key to the value "4"
Allowing USB flash drives again.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor
Set the "Start" key to the value "3"
Blocking FDD floppy drives.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\flpydisk
Set the "Start" key to the value "4"
Allowing FDD floppy drives again.HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\flpydisk
Set the "Start" key to the value "3"
As a bonus - .reg files to block or allow everything.
.reg file to block:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\flpydisk]
"Start"=dword:00000004
.reg file to remove the block:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor]
"Start"=dword:00000003
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom]
"Start"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\flpydisk]
"Start"=dword:00000003
Comments