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?
query user | FIND "citrix" > C:\tempCirtixUsers.txt && FOR /F "eol=; tokens=2,3* delims=, " %i in (C:\tempCirtixUsers.txt) do logoff %i
You need to double up the
%signs in a batch file, and use single in cmd prompt.