title: Direct Batch file to current-user Documents folder
body: <p>I'm on Win 10 with my Documents folder moved to my E: drive via the Windows tool. I need to run a batch file to locate this path, change the current directory within the batch file and copy files from sub-folders to another drive. The batch file needs to be able to be run from any location upon the local PC.</p>
  
  <p>The following returns E:\Users\username\Documents\Test\T1 but it does not actually change the directory within the batch file. </p>
  
  <pre><code>@echo
  for /f "tokens=3*" %%p in ('REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal') do set DocumentsFolder=%%p
  echo %DocumentsFolder%\Test\T1\
  </code></pre>
  
  <p>All copy command lines are in the same section of the batch file. Will one cd at the start of this section effect the whole section?</p>
  
  <p>I would very much appreciate any advice. I frequent this site when looking to learn new things but I could not find this answer.</p>
  
  <p>Thanks Much</p>