AZhu
AZhu

Reputation: 1342

Little script/VB.NET code that will prevent auto-logout in Windows 2003 server edition

I have a Windows 2003 server that we regularly RDP in to monitor some programs that we set up to run on the machine automatically.

However, the server will automatically log me out after a few minutes of inactivity. Unfortunately the server admin (who has the admin rights to the server, which I don't) is reluctant to remove such restrictions "for security reasons".

Therefore, instead of me trying to fill up 10000 piece of paper getting a security exemption, I am just wondering if there is any tiny program that I can run on the server (either a script or some VB.NET code) that will trick the server into thinking I am constantly typing something even though I am not (For example, as if I am moving my mouse cursor once every 30 seconds or type any letter then erase it in notepad)?

Note that since I do not have admin rights, any installation is certainly out of question, and the script, if any, can not require admin rights to run properly.

Thanks so much in advance for your help!

Upvotes: 0

Views: 1657

Answers (1)

John Sobolewski
John Sobolewski

Reputation: 4572

You could try something like this in a vbs ... I am not sure it will work ... but it is worth a try..

set WshShell = WScript.CreateObject("WScript.Shell")
         WshShell.Run "notepad"
         WScript.Sleep 100
         WshShell.AppActivate "Notepad"

Do While True
    WshShell.AppActivate "Notepad"
    WshShell.SendKeys "1234"

    WScript.Sleep 1000
    WshShell.AppActivate "Notepad"
    WshShell.SendKeys "{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}{BACKSPACE}"

    WScript.Sleep 1000

loop

Upvotes: 1

Related Questions