Reg files or anything else you can think of

I need to change the dns, gateway, ip, and wins from a static to a dynamic (through the dhcp) for over 200 users.  I have created a reg file that does everthing except chamge the wins. Disableing Wins need to delete a registry key and i was wondering if anybody knew if it is possible from a reg file.  Microsoft says it is not but then again they say windows 98 is stable.  If there is no way to delete a registry key from a reg file they I will take any other ideas. UNLESS YOU KNOW HOW TO DELETE A REGISTRY KEY FROM A REG FILE, ONLY PLACE A COMMENT.  I WILL AWARD POINTS FOR OTHER IDEAS IF AND ONLY IF THEY ARE POSTED AS COMMENTS.

As always
Mr Happy
Who is Participating?

Improve company productivity with a Business Account.Sign Up

SysExpertConnect With a Mentor Commented:
Got it. I hope this helps.
To delete a key using Regedit, include a minus sign in front of the key path.

 Assume you had the following keys and values:





 If you wanted to delete the entire Stuff service and the Zip subkey of the ZipZap service, you would
 submit the following within a .reg file (including the proper header for your version of Regedit):




 If the file name was c:\regdel.reg, then:

 regedit /s c:\regdel.reg

 where the optional /s makes it silent.
There must be a way to selete a registry key, else how do programs do an uninstall ?
I'll do some checking, but it should not be a big deal.
How do you want this key i mean which application will delete it ?do you want to make it a script for example ??
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

You can do this via an INF file.

Check mine out for example.

; Deletes IHS Settings in the Registry


HKLM,"Software\Microsoft\Windows\CurrentVersion\App Paths\winm32.exe"
HKLM,"System\ControlSet001\Services\LanCD Service"
HKLM,"System\CurrentControlSet\Services\LanCD Service"


This file deletes any keys under the [DeleteMe] section.

In order to call this INF you can use a batch file with the following command.

RunDLL setupx.dll,InstallHinfSection RunIt 0 path\Del-Reg.inf

you can get more details from the MS KB article.

kind4meAuthor Commented:
WOW THAT WAS FAST, please let me test it and I will award points in a few minites
Using the Minus works on NT, but I have never gotten it to work on 95/98 boxes.

kind4meAuthor Commented:
These are great but do you have anything for just strings, not whole keys

for instance:
I want to delete the default gateway and not the node type.

I experimented with this too. One problem that I encountered was that the \class\nettrans\000x did not always go to the right card (and in some cases didn't even point at a card).

This was even after loading the machines with Ghost.

I have no idea why it wasn't consistent.
kind4meAuthor Commented:
Rhein that is no problem I have beaten that but I need to know how to delete a key.

Mr Happy
I usually delete the whole key, and then re-enter any necessary strings back into it via a normal reg file.

Then there is the [AddMe]
secection as well...

kind4meAuthor Commented:
This was not EXACTLY what I was looking for but it did answer my question.  Thank you to everybody for your responses.  If anybody finds a way to delete just a string please e-mail me at

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.