Link to home
Create AccountLog in
Avatar of Wafu
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.

 
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

If you know the keys the create a file with - in front of the key ... http://support.microsoft.com/kb/310516

Avatar of jkr
You can use

reg delete <keyname>

for that once you know the name(s) of these keys.
ASKER CERTIFIED SOLUTION
Avatar of bluebearr001
bluebearr001

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of usacadena
usacadena

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\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\valueStringName"
Avatar of Wafu

ASKER

thanks bluebearr001, spot on. Very dangerous script but did the job very well. A*