Wednesday 11 October 2017

Scripts : Keep Alive Session Avoid Windows Logout being away

FOR /L %%A IN (1,1,1200) DO (
  ECHO %%A
ping 127.0.0.1 -n 60 > nul
)


Copy and paste above code in a file and name it as "something.bat".
Execute the same in a Windows Command Prompt.
If the wait is too long, you can increase both time out and total count
Eg. 1200 is total number of counts
60 is sleep period that the Ping statement waits for.

No comments:

Post a Comment