Wafu
asked on
Batch File to delete Reg Keys
Hi I'm trying to automate cleaning out the of all the keys containing a certain word from the registry of XP PRO clients. It's a pretty obscure word so I'm not concerned about false positives.
I was going to attempt to do it with a batch file but then someone asked me why I wasn't using a merge file (never heard of it before). I'm at loss for either method, can I wildcard with batch files? Anyone have any ideas?
One of our customers has stuffed up a software install and isn't confident enough for me to talk her through manually deleting the keys over the phone and her corporate firewall won't allow a remote session.
I was going to attempt to do it with a batch file but then someone asked me why I wasn't using a merge file (never heard of it before). I'm at loss for either method, can I wildcard with batch files? Anyone have any ideas?
One of our customers has stuffed up a software install and isn't confident enough for me to talk her through manually deleting the keys over the phone and her corporate firewall won't allow a remote session.
If you know the keys the create a file with - in front of the key ... http://support.microsoft.com/kb/310516
You can use
reg delete <keyname>
for that once you know the name(s) of these keys.
reg delete <keyname>
for that once you know the name(s) of these keys.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
regdel.vbs contains:
'This VBS deletes the following subkey "Subkey" with all the
'contents under it leaving the Testing key intact.
Set Shell = CreateObject( "WScript.Shell" )
Shell.RegDelete "HKEY_LOCAL_MACHINE\SOFTWA RE\Microso ft\Windows \CurrentVe rsion\Run\ valueStrin gName"
'This VBS deletes the following subkey "Subkey" with all the
'contents under it leaving the Testing key intact.
Set Shell = CreateObject( "WScript.Shell" )
Shell.RegDelete "HKEY_LOCAL_MACHINE\SOFTWA
ASKER
thanks bluebearr001, spot on. Very dangerous script but did the job very well. A*