Discussion:
Batch file: deleting registry keys
(too old to reply)
HTTP Dr.
2004-01-23 03:26:06 UTC
Permalink
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
Slobodan Brcin
2004-01-23 07:28:35 UTC
Permalink
You can try "reg delete /?"

Regards,
Slobodan
Post by HTTP Dr.
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
KM
2004-01-23 07:22:42 UTC
Permalink
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
Post by HTTP Dr.
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
HTTP Dr
2004-01-24 04:16:05 UTC
Permalink
Thanx!

Both have been helpful!

Continue reading on narkive:
Loading...