Reg Export Document Location Path

0

@echo on

reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal" C:\%username%.reg

pause

I wrote this simple batch to just copy the reg of shell folders. The folder obviously exist because I can see it, but it says invalid path when trying to run it.

Any suggestions? Thanks in advance.

user1115060

Posted 2019-11-22T14:02:33.273

Reputation: 1

Answers

1

Two problems:

  • Personal is the name of a value inside the key of HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders, while the reg export command expects a key-name.

  • The root folder of C:\ is protected against writes.

The correct syntax is:

reg export "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" C:\some-folder\%username%.reg

harrymc

Posted 2019-11-22T14:02:33.273

Reputation: 306 093