Using VBScript to get Idle Time

Posted by Rune on Thu 08 Feb 2007 06:16 PM — 4 posts, 25,392 views.

#0
I'm attempting to run a VBScript on machines on our network to lock computers that are idle for a certain amount of time. I've heard one idea stating that it would be possible to check if the position of the cursor has changed every so often and if it has, the computer isn't idle.

Sadly, I can't seem to find any functions that return cursor positions. Does anyone know how to do this, or perhaps have a different idea about how to lock the computer after a certain idle time using scripting?

Thanks.

I apologize if this isn't MUSHclient related but I didn't really know where else to go.
Australia Forum Administrator #1
I'm not sure if even this will work. Do you mean the mouse cursor (ie. the mouse position, which you can probably get in VBscript), or the text cursor (the flashing thing)?

If you check the text cursor, it is possible the PC is active, but the user is only moving the mouse. If you check the mouse position, it is possible the user is typing, and not moving the mouse.
Australia Forum Administrator #2
In any case, screen savers will do that, why not just use a screen saver that is configured to lock the PC when it activates?
USA #3
If you have a network, and presumably a domain, why not just use the GPO to log machines out after whatever is deemed an excessive time inactive? Otherwise, Nick's suggestion of passwording the screensaver would work just fine - given the removal of user ability to turn off their screensavers.