windowsuserappdatapath

Run command to go to user's documents folder (similar to %appdata%)?


Putting %appdata% into the run window will open up the Appdata folder, but what is the command to open the User's Documents folder, even when someone else logs in? I thought it was something like %userdir%, but I can not find out what it is. Not sure what to search for in Google either so I am at a loss.


Solution

  • There is no environment variable for this. You'll need to set one. Here's a list of all Windows default environment variables:

    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true

    *This is for XP, but should be the same for newer versions of Windows

    For a single terminal session, you can just use

    set USERDOCS=%USERPROFILE%\Documents
    

    For all terminal sessions, you'll need to set a system environment variable. You can do this using the GUI or using setx -m USERDOCS %USERPROFILE\Documents, as described here.

    The command to make this happen would be

    explorer %USERDOCS%

    But if you wanted to make an alias to that (i.e. a openuserdocs command), I can update and explain.