Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scripting using auturn

Tags:

key

registry

I have a VBScript that runs a .reg file (I do this so the user cant see it running)

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "regedit /s C:\Users\John\Desktop\OpenPorts.reg" ,1 ,True
Set WshShell = Nothing

which then runs the .reg file below

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\USBSTOR]
"Start" == dword:00000003

Can I combine this process into 1 VBScript that will make the changes without using a .reg file?

like image 966
Katler Avatar asked May 08 '26 09:05

Katler


1 Answers

This should work :

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\services\USBSTOR\Start", 3, "REG_DWORD"
like image 197
Jesus Avatar answered May 11 '26 11:05

Jesus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!