Link to home
Start Free TrialLog in
Avatar of luders
luders

asked on

Registry Change Via Logon Script

I need to change the value of the default key in HKLM\Software\Microsoft\Windows\CurrentVersion\Run to blank via either my batch file script or my vbs script at logon for the computers in our domain. Some computer have a weird value that is causing the system32 window error at log in.  I have been trying a while and cant seem to find a command that works.  Thanks, Aaron
Avatar of dis1931
dis1931

Delete values:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\MyStuff]
"MyLittleValue"=-
"MyLittleValue2"=-

But if you need to delete entire key

Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\Software\MyStuff]

Place those what you need in a .reg file and run it.  

I would suggest going with deleting the entire Run key and then recreating it empty since you will not know all the values inside them.  Just be careful as people may have legitimate things in there such as Palm software, Antivirus software, etc....
Avatar of luders

ASKER

Okay I tried these options and no luck. I could delete the default value via reg edit which works just as well as changing the default value because it re creates the default value blank. But I could not do either via the scripting. The first option here creates a duplicate default value and the second does nothing. Ideas?

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run]
"(Default)" = " "

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\(Default)]
Avatar of luders

ASKER

Also, deleting the Run key seems no good because as you said there are other legitimate run commands.
ASKER CERTIFIED SOLUTION
Avatar of dlwyatt82
dlwyatt82
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of luders

ASKER

Thats what I am lookin for. Thanks, Aaron