Batch file: deleting registry keys

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top