Saturday
May222010

Keep Active - Keep your session active and beat the screen saver

  • Circumvent the screen saver, hibernate, default disconnect on idle timeout
  • Use this for Windows sessions, RDP, remote control - whatever
  • Keep your session active!

I run processes that take hours to complete.  They don't offer feedback or a progress bar, and require no input for them to continue on their merry way.  Often I'll leave the console while they dutifully run in the background, but when I come back to my computer I find that my Windows/RDP/whatever session has been terminated due to idle timeout.

There's nothing to do but monitor the process and wait for it to complete - wiggling the mouse at odd intervals.  Not a good use of my time.

I wrote a .bat file/.vbs combo that sends keystrokes to the screen.  It keeps my session active while whatever I'm running in the background completes.

The .bat file opens an existing blank .txt file using Notepad.exe (hopefully found in your %WINDIR% directory).  It then calls a .vbs that uses the SendKeys method of the wscript Shell object to input keys into the .txt.

Pick a directory to house the three files (in my example \\ryanboyer.net\Cheating\ - presumably on a Dfs namespace though Dfs isn't required).  Create a blank .txt file and call it KeepActiveAnswer.txt.  Create the .bat and .vbs files whose contents are given below.  Copy a shortcut to the desktop of whatever session you want to stay active while you leave it alone for a bit.

Here's the .vbs script.

Again - you'll need to create a blank .txt file called KeepActiveAnswer.txt and save it in the same directory.