title: Unexpected reference in batch file but works perfectly in cmd
body: <p>I have a very simple set of comands that just create a text of Citrix users logged on to a machine, then reads in the file takes the session id, uses that to logoff the user and then deletes the created text file. When I enter these in the command line by hand it is perfect but I am looking to put them into a batch file. When I try to run the batch file it seems to start then stop right away. Ihave tried to debug it using pauses and timeouts, by doing this I see the issue is that the loop I am using to logoff the users is the problem. Can you please help?    </p>
  
  <pre><code>query user | FIND "citrix" &gt; C:\tempCirtixUsers.txt &amp;&amp; FOR /F "eol=; tokens=2,3* delims=, " %i in (C:\tempCirtixUsers.txt) do logoff %i    
  </code></pre>