# deleting registry keys with a batch file



## rednektec357 (Jan 27, 2004)

I am looking for a way to delete some old symantec ghost entries from the registry on many xp machines. I can do it manually by deleting all symantec keys in the registry but I have way to many of these ps's with this bad image on it and I cant push my new ghost client. I was thinking a batch file would be best for this but I really dont know. Maybe a .inf or a .reg merge. What would you suggest. I dont know enough dos to be able to do this. help please


----------



## Captain_Iglo (Mar 8, 2004)

Hi there,

my suggestion is to create a reg.file as follows:
Find the keys you want to get rid of. IMHO this is the easiest way.
Use notepad or wordpad to write registry files, you just save them with a .reg extension.
The first line in the registry file for XP or 2000 has to be: 
Windows Registry Editor Version 5.00
NOTE: For windows 98, ME, NT 4.0 replace with: 
REGEDIT4
Put a line in between Windows Registry Editor 5.00 and the next entry.
EXAMPLE:
To delete the key 
[HKEY_CURRENT_USER\Key\Subkey]
create the following:
[-HKEY_CURRENT_USER\Key\Subkey]

If you want to delete a value set the value equal to a minus.

EXAMPLE:
To delete the value:
[HKEY_CURRENT_USER\Key\Subkey]"whatever"="whenever"
create the following:
[HKEY_CURRENT_USER\Key\Subkey]"whatever"=-

You may save all changes into one .reg file and deploy it to the desired machines.
Hope this helps.

Regards

Uwe


----------

