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
New: Kanri (Oct 09, 2024), Platform 29.5.3 (Jun 27, 2024)
1,100+ portable packages, 1.1 billion downloads
No Ads November, Please donate today
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!
!!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?
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:
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\
]
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!
edit--
USERPROFILE would've worked great -- if windows put it in MS-DOS format
atleast i got this working: (for XP and 2000 atleast :p)
copy blah.txt %HOMEDRIVE%\docume~1\%USERNAME%
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 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 adding the stuff, one for removing. It runs fine and defiently gets rid of the added stuff thanks anyway
Hello MrNerdHair,
I wouldn't mind seeing this utility you wrote. Others might find it very useful too.
Thanks.
Please can you send me the program, so i try it? Thanks
seeing that program, either. Could fix a couple problems...
Send a copy to me! (You can e-mail it to me -- my e-mail is nm35.53mngmailcom.)
~nm35 {blog} {standalone apps}
Ditto! joy.desgmail.com