How to disable The Plug-and-play for new USB storage devises ?

  • Thread starter Thread starter ranglz
  • Start date Start date
R

ranglz

I manage to disable old USB storage devices and new devices.
When there is a new storage devices connected the PnP open the
options
That enables the operation to browse the HD to locate the drivers.
Is there any option to disable all these dialogs?

My application does not allow the user to access the HD in any way.

Thanks
 
Search for "disable USB storage" in Microsoft knowledge base.
 
disable USB
Dim o
Set o=WScript.CreateObject("WScript.Shell")
o.RegWrite
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start",04,"REG_DWORD"
if
o.regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start")=4
then
msgbox "USB Disable success!"
else
msgbox "USB Disable failure£¬please check perssion!"
end if

enable USB
Dim o
Set o=WScript.CreateObject("WScript.Shell")
o.RegWrite
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start",03,"REG_DWORD"
if
o.regread("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start")=3
then
msgbox "USB Enable success!"
else
msgbox "USB Enable failure£¬please check perssion!"
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top