Batch file: deleting registry keys

G

Guest

I would like to know how to write a batch file to delete 2 registry keys: They are

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock2

I am trying to automate a fix for an annoying error i run across in WinXP
The idea is to fix the TCP/IP issue "something that is not a socket" error

The second half of the fix (reset TCP/IP) I have.

any ideas would be appreciated
 
K

KM

As Slobodan pointed out, you may use "reg.exe /delete" command in you batch
file.

Also, another way to automate the reg.key deletion you may do: regedit.exe
/s <clean_reg_file.reg>.
Where clean_reg_file.reg's content is simply this:

Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock2]

Please note "-" in the front of the reg.key paths.

Hope this helps.
BSquare Corp.,
KM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top