logoff user with .cmd file on destop
I have a code :
@echo off
rem :: Get session ID
for /f "tokens=3" %%I in ('qwinsta /server:10.10.100.1 ^| find /i "
%username% "') do (set _ID=%%I)
rem :: Logoff user
logoff %_ID% /server:10.10.100.1
It works if I type it into command line, but when I take this code and
make .cmd file and put on my desktop nothing happends. Don't know why when
It works. I also tried put (ping localhost -n 1 -w 5000) to give time to
set _ID variable, but didn't help. What could be a problem? Thank you for
your answers.
No comments:
Post a Comment