PortableApps.com Platform and Suite 1.6 have been released.
BAT files for installing/uninstalling REG files?Submitted by Dan2552 on December 14, 2005 - 5:58pm
What command can I put in a batch to import a registry key; and then for a 2nd batch, how would i remove that certain key ( categories: )
|


Commands...
To Export:
REGEDIT /E filename.reg "Registry\Path"
To Merge:
REGEDIT filename.reg
The /S switch will merge silently (use with caution).
Example Backup:
REGEDIT /E httpbackup.reg "HKEY_CLASSES_ROOT\HTTP"
Example Restore:
REGEDIT /S httpbackup.reg
Sometimes, the impossible can become possible, if you're awesome!
OK. Thanks for that, now is
!!edit---
sorry, found the solution for deleting.
-----!!
OK. Thanks for that, now is there like a
REGEDIT /remove HKEY_CURRENT_USER\Software\Borland
which would delete the whole 'Borland' thing?
Deleting Registry keys with batch files
Hi!
This is my first post to the forum and i hope it's usefull.
To remove a key and all subkeys you would just put a minus in front of the key, so to remove putty's setting the regfile would be:
REGEDIT4
[-HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
The big drawback is you have 2 .reg files, one for installing and one for uninstalling/deleting reg keys.
I use batchfiles for almost everything (with several tools), if threr are questions...
Torpedro
oh and almost forgot:
oh and almost forgot:
is there something i can put so the batch file finds the "home" directory of the person logged in on the computer, for example like
copy file.txt %homedir%
(where %homedir% could mean something like c:\docume~1\dan)
[- Home directory: The location of the home directory varies by platform.
Windows 95/98 (single-user): C:\Windows
Windows 95/98 (multi-user): C:\Windows\Profiles\
Windows NT: C:\WINNT\Profiles\
Windows 2000/XP: C:\Documents and Settings\
]
Some tips
You can see the reg command help by typing:
reg /?
from a dos console. You can see the environment variables like %homedir% by typing:
set
from a dos console.
wow. Thanks!
wow. Thanks!
edit--
USERPROFILE would've worked great -- if windows put it in MS-DOS format
atleast i got this working: (for XP and 2000 atleast
)
copy blah.txt %HOMEDRIVE%\docume~1\%USERNAME%
use "%var%" for folders with spaces
Hi!
Why do you need dos format? Instead of
copy file.txt %homedir%you could use
copy file.txt "%USERPROFILE%"Torpedro
Now, Batch files are great
Now, Batch files are great and all, but they do muck up the registry for later users of the computer. I wrote a utility that will load reg entries and change them back to their original values after a program has run. If you want it, reply and I'll post it up.
i made two bats, one for
i made two bats, one for adding the stuff, one for removing. It runs fine and defiently gets rid of the added stuff
thanks anyway
Utility to load reg entries and then clean up...
Hello MrNerdHair,
I wouldn't mind seeing this utility you wrote. Others might find it very useful too.
Thanks.
I want it
Please can you send me the program, so i try it? Thanks
I wouldn't mind
seeing that program, either. Could fix a couple problems...
Show me!
Send a copy to me! (You can e-mail it to me -- my e-mail is nm35.53mngmailcom.)
~nm35 {blog} {standalone apps}
Ditto!
Ditto!
joy.desgmail.com