Link to home
Start Free TrialLog in
Avatar of urzica
urzicaFlag for Israel

asked on

Keep Windows active with either VBScript or Batch file

Hello,

I have a PC in work, which is connected to a network outside my office. I do not have Administrator privileges.

For security reasons, if the user isn't active for 15 minutes, Windows enters that standby mode where you have to press Ctrl+Alt+Del, enter the password and log back in.

My problem is that a specific program that is connected to this outside network disconnects when Windows logs out (after 15 minutes being idle), so when I log back in, I have to restart the whole thing in order to get the program to connect again.

I tried canceling this automatic standby thing, but the user rights I have don't let me change these things (doesn't even let me cancel the screensaver etc.). So I thought of a simple bypass - if I could run some vbscript or batch file (anything that comes with a simple XP setup, I can't isntall new software or connect to the internet) that keeps Windows active, making XP think I'm using the computer, it won't log out and my problem is solved

I tried a batch file that pings many times, but pinging doesn't count as active, as it thinks it's idle and logs out.

Any help would be great..
Avatar of spinzr0
spinzr0
Flag of United States of America image

You can use sendkeys to type a random key every X number of minutes, but then if anyone is using the machine this could cause issues.
Avatar of urzica

ASKER

I thought of that, but I didn't know VBScript (the one Office has) has a timer component like in VB6.
If you could show me how, this may work, because worst case I can just shut the program off when I use the PC, and turn it back on when I leave it.

I would prefer some way that I wouldn't have to turn it on and off every time I use/leave the computer (for instance if it could recognize that i started using the pc, or if it doesn't include pressing random keys), but it still is better than nothing.
I was looking around for another way to do this, and found a freeware that does exactly what I was suggesting.  Check this out: http://www.zhornsoftware.co.uk/caffeine/index.html

Or, you could use Auto-IT to move the mouse.  Also freeware from http://www.autoitscript.com/autoit3/ and to activate its just:

While 1  
 
sleep(60 * 5000)  
 
;  MsgBox(0, "", "")  
 
MouseMove(10, 100)  
 
WEnd  
ASKER CERTIFIED SOLUTION
Avatar of Darren Collins
Darren Collins
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of urzica

ASKER

Thanks a lot Daz_1234, your solution is great. I can leave it on even when I'm working on the computer because it presses the buttons fast enough so it never (99% of the time) interferes with typing.

spinzr0, thanks for trying. As I mentioned, I can't transfer anything into this computer, nor can i install software or use the internet.

Thanks a lot.
How do I run a hta file?1
Nevermind.. Just double click :)