VB Scripting

Hello all you VB experts...I am not one.

I need a script or at least help with a script that will

Check this key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsbStor\Start

And then look at the dword value.  I want it to set the dword value to 4 regardless of what the value is, and then pop up a window on their screen that says "Success" with a button to click ok to get rid of the screen the script just created.

Anyone know how to do that?  I've googled relentlessly and i've found all kinds of ways to delete, but not edit an already existing key.  If anyone could help I would appreciate it!
tonyestradaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bartender_1Microsoft Network AdministratorCommented:
I'm not sure about vb scripting, but in the command prompt, you could use this:

reg add HKLM\SYSTEM\CurrentControlSet\Services\UsbStor\ /v Start /t REG_DWORD /d:4 /f

Hope this helps!

:o)

Bartender_1
merowingerCommented:
with vbscript
set objShell = CreateObject("Wscript.Shell")
objShell.RegWrite "HKLM\System\CurrentControlSet\Services\USBStor\Start",4, "REG_DWORD"
Wscript.Echo "Success"

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve KnightIT ConsultancyCommented:
Or just use a .REG file exported of the right key and use:

regedit /s file.reg

which is OK on Windows NT upwards.  the REG.EXE command way is fine unless you have any Windows 2000 machines still since they don't have reg.exe.
tonyestradaAuthor Commented:
Both worked!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.