[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 449
  • Last Modified:

regedit delete switch

Is there a command line switch for regedit that will allow me to remove a single string value from a key?  I'm trying to automate the removal of an application that is starting at boot without having to visit 180 machines.
0
smcurry
Asked:
smcurry
  • 5
  • 4
  • 3
  • +4
1 Solution
 
sgentherCommented:
I use a great program called "Multi-remote registry change".It alows you to connect to any machine Via the Computer Name and change the registry,The shareware version lets you change up to 20 pcs at a time right from you desktop. You can fine it here:
http://home.zdnet.com/windows/nt/downloads/registry.html
0
 
smcurryAuthor Commented:
I'm not completely unhappy with the sgenther's answer, however I would still like to find out if this is possible using regedit.
0
 
sgentherCommented:
regedit is not a command line app its a gui app,You can do it with regedit by connecting to each remote pc then deleteing the key...but with 180 pc...that could take awhile.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
smcurryAuthor Commented:
I understand the GUI aspect of regedit but I'm wondering if there is something similar to the /s switch that can be used with a text .reg file to add entries into the registry.  

For example: regedit /s foobar.reg - foobar.reg would contain something like:
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"NotePad"="NotePad.Exe"

This key would start notepad whenever the computer is booted.

Actually, it is an in entry in the key above that I want to remove.

Most documentation doesn't list the /s switch as an option for regedit.  I'm wondering if there is another hidden switch that I can't find.
0
 
sgentherCommented:
Sorry about that....I was on the NT think bus!
The syntax and command-line switches for Regedit in real mode are as
follows:
 
  REGEDIT [/L:system] [/R:user] filename1
  REGEDIT [/L:system] [/R:user] /C filename2
  REGEDIT [/L:system] [/R:user] /E filename3 [regpath]
 
    /L:system         Specifies the location of the System.dat file.
    /R:user           Specifies the location of the User.dat file.
    filename1         Specifies the file(s) to import into the registry
    /C filename2      Specifies the file to create the registry from.
    /E filename3      Specifies the file to export the registry to.
    regpath           Specifies the starting registry key to export from.
                      (Defaults to exporting the entire registry).
 
To see this list, type "regedit /?" (without quotation marks) at the
command prompt.
This is all I could find.
0
 
smcurryAuthor Commented:
As you can see the /s switch is not included and I'm may have been misleading earlier.  It isn't require to import a file but it allow is to occur "silently" without the end-user seeing it.

There actually a /d switch I've gleaned from looking at the regedit.exe.  However, it only applies to an entire key and not just a single value.

Ideally I would like to remove just the single value but I suppose I could work something up that would export the key, remove the value from the export file, delete the key from the registry and then import.  More work and potentially a little more dangerous given it relies on deleting the entire key.
0
 
sgentherCommented:
I still say give that program a try...Its great...I had to make changes on about 150 pcs (5 changes to be exact) and even with the 20 at a time limit I was done in under an hour.
0
 
smcurryAuthor Commented:
As you can see the /s switch is not included and I'm may have been misleading earlier.  It isn't require to import a file but it allow is to occur "silently" without the end-user seeing it.

There actually a /d switch I've gleaned from looking at the regedit.exe.  However, it only applies to an entire key and not just a single value.

Ideally I would like to remove just the single value but I suppose I could work something up that would export the key, remove the value from the export file, delete the key from the registry and then import.  More work and potentially a little more dangerous given it relies on deleting the entire key.
0
 
uilleannCommented:
It can be done from a VB app, so if you know some programmer you could ask him/her to write you a program to do it.
Or you could post in the VB section with this question.

Good Luck!
0
 
hddp666Commented:
It would be pretty simple to write a program that searches for the string you want to remove from the *.reg file, and then gets rid of it. In effect, you search for the string within the file, clip everything before and after it, and then paste them together to form the new file without the string.

You would have to know exactly what you want to remove from the *.reg file, of course.

You can write it in VB, C++, Delphi or whatever, and then compile it. You would then run it on all the machines, either from a diskette, or distributed over a network. The .exe can delete itself after it has done what it's supposed to. It should also create a backup of the file before changing it, in case you need it.


If you want, I can write the program for you.
0
 
KoenCommented:
Don't bother writing programs which are available as freeware/shareware...

I pasted this from jsiinc (it's for NT but I'm sure it will work on W95 also)

170 » Freeware Command Line / Batch Registry & Environment editor.

REG is a handy Registry and Environment Variable batch and command line tool that supports operations
on the following Registry Hives:

    HKEY_LOCAL_MACHINE
    HKEY_USERS
    HKEY_CURRENT_USER

REG will:

 Add and Delete a Registry Key.
 Add, Delete and Change a Registry Value. It supports Value Types of:

    REG_SZ
    REG_DWORD
    REG_MULTI_SZ
    REG_EXPAND_SZ

 Add and Delete a directory in either the SYSTEM or USER PATH.
 Setting an Environment Variable in either the SYSTEM or USER environment.
 Setting Environment and PATH variables from a file.
 Setting multiple options from a file.
 Setting a Registry Value from the keyboard.

the url is : http://www.jsiinc.com/TIP0100/rh0170.htm
and has a link to download.  You could then create a batch file running this through the login script.

Good Luck
Koen
0
 
smcurryAuthor Commented:
I dl'd the utility REG and did some testing and it appears that it will do exactly what I'm looking for.

Thanks to all who answered, especially Koen who pointed out the utility.

This is my first posting to the service.  What is the procedure for assigning points or closing the question?

Sean
0
 
tcalesaCommented:
Ghinstek,
I wish you had included that as part of you answer to my reg Q! I've been fiddling with regini, what a pain.

But I do appreciate your posting here, I'll use it.
Thanks
0
 
korvanCommented:
smcurry: you have to reject any outstanding answers and request (via comment) that the person you wish to award the points to has to re-submit their comment(s) as an answer.
0
 
KoenCommented:
smcurry,

since it seem to have worked I'll repost as an answer :



I pasted this from jsiinc (it's for NT but I'm sure it will work on W95 also)

170 » Freeware Command Line / Batch Registry & Environment editor.

REG is a handy Registry and Environment Variable batch and command line tool that supports operations on the following Registry Hives:

HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_USER

REG will:

Add and Delete a Registry Key.
Add, Delete and Change a Registry Value. It supports Value Types of:

REG_SZ
REG_DWORD
REG_MULTI_SZ
REG_EXPAND_SZ

Add and Delete a directory in either the SYSTEM or USER PATH.
Setting an Environment Variable in either the SYSTEM or USER environment.
Setting Environment and PATH variables from a file.
Setting multiple options from a file.
Setting a Registry Value from the keyboard.

the url is : http://www.jsiinc.com/TIP0100/rh0170.htm 
and has a link to download.  You could then create a batch file running this through the login script.


Good Luck
Koen
0
 
KoenCommented:
tcalesa,

I'm sorry but I don't recall your question about registry... Also I wasn't at all sure about it solving the problem since this utility came from the NT environment (which is why I posted as a comment...)

Regards
Koen

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 4
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now