Windows 7 Environment variables


  1. Posts : 2
    Windows 7 Home Premium 64
       #1

    Windows 7 Environment variables


    Is there an Environment variable that can tell me where the Documents folder is located? Typically, the Documents folder is located in C:\Users\username\Documents.

    I am creating a batch file to copy 1 file from a remote location (another computer in the network) to the Documents folder. Since the location can vary on each computer, I would like to use an environment variable to avoid any errors. I ran Set from the command prompt, I got a list of all environment variables, but don't see anything related to the Documents folder.:)
      My Computer


  2. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #2

    Assuming the Documents folder is located in Users\Username\Documents, it can be found with %userprofile%\documents.

    This works also if user profiles are relocated to another partition or drive but not if the Documents folder is located outside the main user profile folder using Folder Properties > Location > Move.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:27.
Find Us