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!

Reg export problems - not overwriting existing files

Status
Not open for further replies.

dporrelli

Programmer
Dec 18, 2002
43
GB
I'm trying to run a batch file which backs up certain files and the HKLM of the registry, got the files fine using robocopy but struggling using reg export for the registry. I can get it to do the task once, but when I try again it will not overwrite the existing file. Checked on MS site and it says to put in /y at the end and it should work, but I get an error "the system was unable to find the specified registry key or value".
Full command : reg export hklm c:\regtest.reg/y, I also tried it with a space before the /y and get "invlaid command line parameters".

Thanks in advance for any help.
 
Running on Windows XP (I dont have a W2K machine to try sorry), I can use the command

Code:
reg export hklm c:\regtest.reg
and it will successfully write to the file, or overwrite an existing one. I don't need a /y on the end. Admittedly, that may not work on W2K...

Looking at your command, you seem to be missing a space - have you tried the following?

Code:
reg export hklm c:\regtest.reg /y
Alternatively, why don't you just delete the existing file if it exists, prior to running the export?

Code:
IF EXIST C:\regtest.reg del C:\regtest.reg /f


[ponder][laughtears] The dumber they think you are, the more surprised they'll be when you kill them! [machinegun][rofl2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top