Exporting/Importing Registry keys

G

Guest

Hi,

What is the best/recommend way to export and import custom registry keys.

I use
reg export <RootKey>\<SubKey> <FileName> /y

The problem is this works great on Windows 2003 SP1 but the '/y' option is
missing in Windows XP SP2. I cannot run this command in an interactive mode
and hence '/y' is really important.

Any suggestions/clues.

Thanks
Vidya
 
G

Gel

from dos run command "regedit"

Then select "file/export"; remember where to!!

To run, right click and select "merge" I recall.
 
G

Guest

Hi,

Thanks for the response. But my problem is "I cannot run in an interactive
mode" - I need something that is non-interactive. This will not work.

Any other suggestions?

Thanks
 
A

Alan Edwards

Regedit can be run with no interaction.
Here is a one line batch file to export a specific key:
(One line but may wrap)

REGEDIT /e url.reg
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\URL

Here is a one line batch file to merge that key:

REGEDIT /s url.reg

You can specify a path for the filename if you wish.
Enclose any key with spaces in quotation marks.

....Alan
 
N

NewScience

Have you tried creating a text file with the letter 'y' in it.
reg ..... < c:/y

There is another way using echo with a '|' I believe

@echo y | reg ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top