JC said:
I want to automatically logoff a session when it has been idle for a
configurable time.
In several sources out there I've seen that the better way to do this is to
use a screen saver like "winexit", but I haven't been able to use it and to
work without the "Force application termination" option. The problem with
this option is that the system does not wait the application to terminate,
and I need that because the application must do some things before ending.
The configuration I've used is to configure a screen saver ("winexit.scr")
and screen saver activation time in Active Directory (Windows 2000 server)
in a "group policy"
b) Clients are Windows XP clients
I need a better solution to do this. Has anyone solved a problem like mine
(automatic logoff but waiting the applications to finish) ?
Hi
You could create an scheduled task that starts at user logon and is
configured to kick in at a set idle time. Let the scheduled task
launch a script that handles the closing of the app and then logs the
user off.
If you want to use WinXP's shutdown.exe utility, and the user to be
logged off is not the same as the one that is defined in the task,
you might need to enable the remote shutdown privilege for the task
user even if you are going to only operate on the local computer.
If the task user is a member of the local Administrators group, I
think the privilege is already in place.
Take a look here for how to add remote shutdown privilege:
http://groups.google.co.uk/[email protected]
Anyway, Psshutdown.exe in SysInternals's free PSTools suite does not
suffer under this limitation and is the tool I recommend to use in
this case.
http://www.sysinternals.com
Alternatively, to avoid any 3rd party tool, you can use a VBScript
instead (I don't think it have the same issue as shutdown.exe, but I
am not 100% sure):
http://groups.google.co.uk/[email protected]
For the application closing part:
The free command line utility Cmdow.exe is an option, using the /CLS
or /END switch.
http://www.commandline.co.uk/cmdow/index.html
More about this here:
http://groups.google.co.uk/groups?t...82a5.0410130525.43a7fe48%40posting.google.com
Another option is to use use AutoIt/AutoItX and e.g. it's
WinClose function.
Here is an example on WinClose:
http://groups.google.co.uk/[email protected]
AutoIt/AutoItX is free and can be found here:
http://www.hiddensoft.com/autoit3/index.php
AutoItX is an ActiveX control version of AutoIt and can be used from a
vbscript.
Note:
AutoIt(X) window handling defaults to match the start of a window title that
you specify, use "SetTitleMatchMode 2" to specify ANY substring of the window
title you want to match. Also, the Windows titles and text are case sensitive.