Sign in to follow this  
Followers 0
Smitro

Auto Logoff

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



Shutdown(20) ;0 + 4 + 16


[center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Genius, It worked!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0