Smitro Posted February 20, 2009 Share Posted February 20, 2009 Hi all, I've written a small app that after 1 hour asks my users if they are still using the computer, if they do not respond the user will be logged off. On the computers I have this running, most users only need to user the machine for 50 mins, after that there is a good chance they have walked off and left the machine logged on and they are tying up the machine, and others can't use it. Here is the script I use: ; Hide the Tray Icon Opt("TrayIconHide", 1) ; Wait for 1 hour Sleep (3600000) $message = MsgBox ( 32, "Computer Usage", "Is this computer still being used?"& @CRLF & @CRLF &"Yes - click the OK button."& @CRLF & @CRLF &"If the OK button is not clicked within 3 mins the computer will automaticly log you off." , 180 ) if ($message = -1) Then ; Force a log off. Shutdown ( 16 ) EndIf In most cases this would work, but some users leave windows open that require attention before they can be closed. For example, unsaved word documents that ask you if you want to save before closing and Internet Explorer windows that ask if you want to close all tabs. In these cases the computer is left with the end task window and the button that says "End Now", I would have thought to Force using "shutdown(16)" would ignore all that and log the user off. Is this correct? Is there any more I can do? Is there a better way I can do something like this? Link to comment Share on other sites More sharing options...
system24 Posted February 20, 2009 Share Posted February 20, 2009 Shutdown(20) ;0 + 4 + 16 [center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center] Link to comment Share on other sites More sharing options...
Smitro Posted February 20, 2009 Author Share Posted February 20, 2009 Shutdown(20) ;0 + 4 + 16 Double the Force hey? I thought about it, but I thought it was unnecessary. I'll give it a go. Link to comment Share on other sites More sharing options...
Smitro Posted February 20, 2009 Author Share Posted February 20, 2009 Genius, It worked! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now