I have a task and no idea how to tackle it!
Basically, I want to disable the CD drive on a PC so our users can't use them.
That's how I want to start anyway - ultimately I'd like an icon in the system tray that allows the CD drive(s) to be locked and unlocked providing you know a password.
I need somewhere to start though - does anyone know how to disable the use of a CD drive in VB.net?
Any help would be appreciated.
Andrew
I found a way to do this.
Basically I needed to loop through all the items in the device manager like this:
I then took the DeviceID and ClassGuid sections.
If the Guid matched {4D36E965-E325-11CE-BFC1-08002BE10318} which is the GUID for a CD/DVD player, I told it to disable/enable the device dependent on what the user wanted to do.
To enable or disable them, I found this handy program all ready to go from here .
I then simply edited Form1.vb this:
Public Class Form1
End Class
That will then loop through the CD/DVD drives in device manager and disable/enable them.
I have yet to tidy the code up - and I need to run the script as a thread because it hangs at the moment while it's doing it's thing.
I also intend to get the program to work out what state the CD drives are in using a timer event - and then report back accordingly... I then need to get it to run in the system tray with no form and finally get it to run as the LSA with desktop interaction enabled.
I'll finish it when I get a moment - but everything you need should be here.
Hope this helps someone out a bit!