Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a .reg file

Status
Not open for further replies.

nerram

Programmer
Apr 23, 2003
56
IE
I need a Vbscript to run a .reg file silently but am having great difficulty in doing. Will I have to parse in the whole file. Any ideas?
 
Hello nerram,

If it is to import a .reg on a local, then do this.
Code:
dim wsh
set wsh=createobject("wscript.shell")
cmdline="regedit.exe /s abc.reg"
wsh.run cmdline
set wsh=nothing
It would import silently the settings as coded in abc.reg. Care to specify the full path if it is not at current directory as the script.

regards - tsuji
 
Sorry I forgot to mention i need it to uninstall a .reg file
 
nerram,

Uninstall or install, it is the same vbscript. .reg file can handle most of the key / value deletion. So what can I help in your uninstallation. Show what you want concretely.

- tsuji
 
I made a mess of this question. So to start over :
I have a .reg file that I need to install, I then need to some testing and finally I need to uninstall same .reg file. Uninstalling the reg file is where I am having problems. Is there a command line switch on regedit to uninstall a reg file?
 
The short answer is no. You committed a .reg file. Registry got changed. The original setting disappeared unless you had back that part up beforehand. What does it contain in your original .reg that is my question. You can still do the reverse (in certain cases only) by a new matching .reg. (I am not saying scanreg/restore).

-tsuji
 
not allowed to show you the reg file. But your reply has kinda answered my questions anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top