How to create a batch file for removing one Entry in a registry key

Scotty83

Honorable
Apr 29, 2013
5
0
10,510
Hi Everyone,

New to forum here, and looking for some help with create a batch file.

I have in the registry, 2 entries, in one key and one of them needs to be removed. I will have to do this one several hundred computers, Any help would greatly be apprecaited.
 
It probably goes without saying tat the Registry is a risky place to play with but I'm saying it anyway because more folks than just you might read this. It's therefore important to write a script that backs the Registry up as well as modifying it.

All that said, Batch files have largely been overtaken by VB Script for this purpose but have a thorough read this KB, which I think you'll find helpful http://support.microsoft.com/kb/310516

EDIT - Oops sorry, thently - failed to notice you'd already linked to that KB.

 

Scotty83

Honorable
Apr 29, 2013
5
0
10,510


Thanks Saga and Thently for the links, I do have back ups so I'm not worried in the dept.

I'm very green when it comes to this type of work so please forgive me if I ask something dumb.

What I need to do is to remove one of 2 entries from within the "\\computername\HKLM\software\microsoft\Windows NT\CurrentVersion\Winlogon"
Key has 2 entries "C:\Windows\System32\Userinit.exe & C:\Windows\System32\KUserinit.exe. Need to remove the first entry.

Have tried using the code
REG DELETE \\Computername\HKLM\software\microsoft\Windows_NT\CurrentVersion\Winlogon /v userinit without success, tried that as a .reg, .cmd & .bat.

have also tried the following code without any luck either.....

REGEDIT4
\\computername[HKLM\software\microsoft\Windows NT\CurrentVersion\Winlogon\Userinit]
userinin.exe=-