1

In windows, I can move (change the location of) special folders / directories like Videos, Pictures, Downloads, Documents (ex. "My Documents"), etc. via right-clicking them, selecting Properties, Location (former Target) tab, and move.

documents properties target move

documents properties location move

I've tried search engines but failed:

How do one performs moving these folders to a new location from the command line?

3 Answers 3

4

If you're doing this for a lot of computers, then you don't want to do it from the command line, you want to setup a "Folder Redirection" group policy, and that will do it all for you.

However I assume that you're just doing this for your own PC, the easiest way is probably via the registry keys for the User's Shell Folders. For example, your My Documents folder location should be held in the Personal value in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders.

From the command line, you could use the reg.exe tool to change that using a command like:

reg ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Personal /t REG_EXPAND_SZ /d "D:\My Documents"

However, doing this through the GUI (as in your question) or using Group Policies are the supported ways to do it. Poking values into registry keys as I've explained above should not be attempted unless you really know what you're doing, and can handle the consequences of getting it wrong.

0

All the special folders are subfolders under C:\Users\<your login name> , you can change into the directory and use "dir" to find out their names and use them in command line parameter.

1
  • Thank you for the answer, I think my question was misworded. I meant I would like to set a new target ('move') for these folders. So windows tries to find them elsewhere, not at their default location. For example move from c:/users/someuser/Documents/ to g:/somenicefolder/documents/
    – n611x007
    Oct 27, 2014 at 10:47
0

You can use environment variables at the command prompt. Instead of typing "c:documents and settings\yourname\documents... etc., just use %HOMEPATH% variable, which is dynamic and points to the documets folder of the current user.

At the DOS-prompt type: CD %HOMEPATH%\documents

This will take you to the docoments folder for the current user. Try typing DIR and you will see the same files and folders as you see in Windows Explorer. - From here you can use COPY, MOVE, DEL etc. - If you are unsure of the syntax on these commands, type MOVE /? (or COPY/?) to see the options.

/Jesper

1
  • Thank you Jesper, I may have misworded my question, I've tried to clear up the question now. I understand I can cd with the environment vars. What I would like to do is, replace the target folder location for the Document folder, so it is not under c:/users/someuser/Documents anymore, but something like G:/somenicefolder/documents.
    – n611x007
    Oct 27, 2014 at 10:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .