windows - Exporting Entire Registry To Relative Path -


using following code

regedit /e c:\output.reg 

a registry dump file created in c directory. overwrites automatically when file same name exists. when try changing output directory relative path this

regedit /e output.reg 

it wouldn't work.

no file created processing takes long usually. code can export whole registry using relative path?

like requested, .bat code including debug code:

echo %cd% regedit /e output.reg pause 

command line output:

c:\users\username\desktop\new_folder>echo c:\users\username\desktop\new_folder c:\users\username\desktop\new_folder  c:\users\username\desktop\new_folder>regedit /e output.reg  c:\users\username\desktop\new_folder>pause press key exit . . . 

folder before (and after) .bat file execution:

the syntax of command given in question fine. if supply relative path output file name file created relative current working directory. verified interactive command prompt.

whatever going wrong batch script, problem not have surmised. of more obvious explanations include:

  1. the working directory not think is. verify adding debug code script emit working directory.
  2. the file locked reason , regedit cannot write file.
  3. you don't have sufficient rights write working directory.

update

thanks lot question update. tried re-create scenario (i'm on windows 7 doubt matters) , indeed find same issue you. command works fine interactive console window, not when executing in batch script.

i've no idea why is, here simple enough workaround supply full path:

 regedit /e %cd%\output.reg 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -