title: What's the environment variable for the path to the desktop?
body: <p>I'm writing a Windows batch file and want to copy something to the desktop. I think I can use this:</p>
  
  <blockquote>
    <p>%UserProfile%\Desktop\  </p>
  </blockquote>
  
  <p>However, I'm thinking, that's probably only going to work on an English OS. Is there a way I can do this in a batch file that will work on any internationalized version?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I tried the following batch file:</p>
  
  <pre><code>REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop
  FOR /F "usebackq tokens=3 skip=4" %%i in (`REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop`) DO SET DESKTOPDIR=%%i
  FOR /F "usebackq delims=" %%i in (`ECHO %DESKTOPDIR%`) DO SET DESKTOPDIR=%%i
  ECHO %DESKTOPDIR%
  </code></pre>
  
  <p>And got this output:</p>
  
  <pre>
  S:\>REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop
  
  HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
      Desktop    REG_EXPAND_SZ    %USERPROFILE%\Desktop
  
  
  S:\>FOR /F "usebackq tokens=3 skip=4" %i in (`REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folder
  s" /v Desktop`) DO SET DESKTOPDIR=%i
  
  S:\>FOR /F "usebackq delims=" %i in (`ECHO ECHO is on.`) DO SET DESKTOPDIR=%i
  
  S:\>SET DESKTOPDIR=ECHO is on.
  
  S:\>ECHO ECHO is on.
  ECHO is on.
  </pre>