Using batch or script to remove reg values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I am looking for a way to batch or script the removal of Registry
values (not keys) in the registry. I need to do it to many desktop PCs. Is
there a good way to do it
Thanks
 
Brad said:
Hello, I am looking for a way to batch or script the removal of
Registry values (not keys) in the registry. I need to do it to many
desktop PCs. Is there a good way to do it

use reg files and put minue (-) in front of the key you want to remove.
 
Thanks I have tried this
REGEDIT4
["hkey_local_machine\software\odbc\odbc.ini\odbc data sources"]
"FMProd"=-
With no luck. FMProd is the value name (of the string?) I do not want to
actually delete the key "odbc data sources"
Have I got this command right?
 
Key names don't have inverted commas.

--
----------------------------------------------------------
http://www.uscricket.com
Brad said:
Thanks I have tried this
REGEDIT4
["hkey_local_machine\software\odbc\odbc.ini\odbc data sources"]
"FMProd"=-
With no luck. FMProd is the value name (of the string?) I do not want to
actually delete the key "odbc data sources"
Have I got this command right?

Shenan Stanley said:
use reg files and put minue (-) in front of the key you want to remove.

--
<- Shenan ->
--
The information is provided "as is", it is suggested you research for
yourself before you take any advice - you are the one ultimately
responsible for your actions/problems/solutions. Know what you are
getting into before you jump in with both feet.
 
Brad said:
Hello, I am looking for a way to batch or script the removal of Registry
values (not keys) in the registry. I need to do it to many desktop PCs. Is
there a good way to do it

Example registry .reg file to do this:

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}]
"UpperFilters"=-
"LowerFilters"=-

That deletes the two values UpperFilters and LowerFilters from that key
- setting as =- is taken to imply deletion

Make sure that there is a blank line at the end of the file
 
Brad said:
Thanks I have tried this
REGEDIT4
["hkey_local_machine\software\odbc\odbc.ini\odbc data sources"]
"FMProd"=-
With no luck. FMProd is the value name (of the string?) I do
not want to actually delete the key "odbc data sources"
Have I got this command right?
Hi

1)
This should work better:

--------------------8<----------------------
REGEDIT4

[HKEY_LOCAL_MACHINE\software\odbc\odbc.ini\odbc data sources]
"FMProd"=-

--------------------8<----------------------
(note blank line at end)


2)
You can use reg.exe as well (comes builtin with WinXP):

REG.exe DELETE "HKLM\software\odbc\odbc.ini\odbc data sources" /v FMProd /f


3)
With a VBScript:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
oShell.RegDelete "HKLM\software\odbc\odbc.ini\odbc data sources\FMProd"
'--------------------8<----------------------
 
Thanks
That works great

Torgeir Bakken (MVP) said:
Brad said:
Thanks I have tried this
REGEDIT4
["hkey_local_machine\software\odbc\odbc.ini\odbc data sources"]
"FMProd"=-
With no luck. FMProd is the value name (of the string?) I do
not want to actually delete the key "odbc data sources"
Have I got this command right?
Hi

1)
This should work better:

--------------------8<----------------------
REGEDIT4

[HKEY_LOCAL_MACHINE\software\odbc\odbc.ini\odbc data sources]
"FMProd"=-

--------------------8<----------------------
(note blank line at end)


2)
You can use reg.exe as well (comes builtin with WinXP):

REG.exe DELETE "HKLM\software\odbc\odbc.ini\odbc data sources" /v FMProd /f


3)
With a VBScript:

'--------------------8<----------------------
Set oShell = CreateObject("WScript.Shell")
On Error Resume Next
oShell.RegDelete "HKLM\software\odbc\odbc.ini\odbc data sources\FMProd"
'--------------------8<----------------------




--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
 
Back
Top