title: Why does this script run differently on different accounts?
body: <p>Okay, so I've written a reprofile script for copying/pasting local files.
  The file works fine, but it doesn't always give the first 'CHOICE' command.</p>
  
  <p>It seems to be happening when the C:\temp\logs folder doesn't exist. If that folder doesn't exist it will jump to :COPYFILES. If it's there it works fine. Could anyone revise my code? Maybe there's something wrong with that initial 'IF NOT EXIST' statement that I can't see...
  Thoughts?</p>
  
  <pre class="lang-bat prettyprint-override"><code>@echo off
  for /F "tokens=1,2" %%i in ('qwinsta /server:%COMPUTERNAME% ^| findstr "console"') do (set loggedInUser=%%j)
  
  setlocal
  
  echo Logged In User: %loggedInUser%
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  
  :INTRO
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  echo Logged In User: %loggedInUser%
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  
  :CHECKLOGS
  IF NOT EXIST "C:\temp\logs\" (
      mkdir "C:\temp\logs\"
      echo.&gt;"C:\temp\logs\appsense_BACKUP_robo.txt" 
  ) ELSE (
      echo.&gt;"C:\temp\logs\appsense_BACKUP_robo.txt" 
  
      :STARTPROMPT
      CHOICE /C 12 /N /M "Are you wanting to: Copy Files [1] OR Paste Files [2]?"
      IF ERRORLEVEL 2 goto PASTEFILES
      IF ERRORLEVEL 1 goto CHECKEXIST
  )
  
  :CHECKEXIST
  IF EXIST "C:\temp\appsensebackup\%loggedInUser%" (
      echo APPSENSE BACKUP FOLDER FOR %loggedInUser% ALREADY EXISTS.
  
      CHOICE /C 12 /N /M "Would you like to: Delete Previous Backup [1] OR Cancel [2]?"
      IF ERRORLEVEL 2 goto USERCANCEL
      IF ERRORLEVEL 1 goto REMDIR
  ) ELSE (
      GOTO :COPYFILES
  )
  
  :REMDIR
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  GOTO :COPYFILES 
  
  :COPYFILES
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  EXIT
  
  :PASTEFILES
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  EXIT
  
  :USERCANCEL
  REM REMOVED AS UNRELATED [NOT MINIMAL] CODE
  
  endlocal
  </code></pre>