That's any body now how to lock removable media using C#, OS that using is Windows XP.

Thanks for help :D

8 Years
Discussion Span
Last Post by wildog

i know that you wanted C# help but leave it.
i did a script using a batch, working like a charm.
i got 500 "media locked" computers on my company.
i attched 2 zip files.
in each file there are 3 .REG files.


lock_USB.reg - Locking just usb mass storage device (disk on key and other storage devices) it isn't locking usb mouse ,printers, scanners etc.
lock_CDROM.reg - Locking CD-ROM
lock_Floppy.reg - Locking Floppy disk


unlock_USB.reg - disables the lock on the usb
unlock_CDROM.reg - disables the lock on the cdrom
unlock_Floppy.reg - disables the lock on the floppy disk

just import the files into the registry and walla !

the cd_rom and floppy disk locks needs to restart in order th apply.
You can import the .REG files into the windows registry using batch file (to do a statup script on GP or any other way):

regedit /s [name of the reg files]


regedit /s lock_USB.reg

You can either change the registry keys using c# or any other way.

that's it, GL.

if you need any more help, just email me: wildog@gmail.com.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.