Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am writing a batch file to migrate certain settings from one windows machine to another. I'm having problems with the regedit /e switch.

In the script, I'm exporting ODBC system entries and Internet Explorer Trusted Sites. The ODBC command exports successfully, but the Trusted Sites command doesn't.

echo Exporting ODBC Information
start /wait regedit.exe /e "y:\%username%\odbc.reg" HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI

echo Exporting IE Trusted Sites
start /wait regedit.exe /e "y:\%username%\TrustSite.reg" HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\INTERNET SETTINGS\ZONEMAP\DOMAINS

Do I need to tack on something after DOMAINS?

Thanks for the help! I'm either breaking new ground with this, or the problem is so simple that the solution appears nowhere on the Internet. Sigh

share|improve this question

1 Answer 1

up vote 2 down vote accepted

There's a space in the key path. Wrap it in double-quotes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.