Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

VB code for editing registry key HKEY_LOCAL_MACHINE for flashdrives disabling

$
0
0
in my college project, i am trying to make an application using VB6 i which the USB ports will be disabled for pendrives only. other USB devices like keyboard mouse will be operating fairly, but the pendrives wont be detected by the system. Only when i give a password, then the Pendrives will be detected by the system using USB..

i am new to vb6, so i am facing quite a prob regarding this,

i found a artcle which is over here given below, but i want to make the same as a vb6 application

here;s the link

http://www.howtodothings.com/compute...e-devices-only

I need to edit a registry key and set the data value to "4"

I know how to do it through the command prompt but am trying to find some Visual Basic code to do it.

If it helps, this is the key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\USBSTOR\Start

I got a sample code here, but dnt knw how to proceed

Dim reg As New RegistryClass

With reg
.SetKeyValue .HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Services\USBSTOR", .RegDWORD, "Start", 4
End With

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>