Jump to content

Auto Logoff


Smitro
 Share

Recommended Posts

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...