screen saver for auto log off after a certain period of idle time

S

Shenan Stanley

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) ?

The problem is catch 22..

If you are waiting for the application to finish to log me off, what is to
stop me, the savvy user, from making sure my applications NEVER finish while
I am away?
 
J

JC

Hi:

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) ?

Thanks,
Juan Carlos
 
J

JC

Well, I have an application that finishes in about half a second. I think
that waiting the application to finish for 10 seconds and then finishing it
is not bad for me. Is there a way to do something like this?
Also, I will be using this configuration for a system that has this
requirements (auto log-off) and other applications are not important.

Juan Carlos.
 
T

Torgeir Bakken \(MVP\)

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.
 
T

Torgeir Bakken \(MVP\)

JC said:
Ok, thanks for your answer.

I've seen some of the tools you mention, but I didn't understand
how to "catch" the event "the PC has been idle for X time" on a
client. How would I do that?

Create a scheduled task, and then under the Schedule tab select
"When idle" in the drop down menu, and select the number of
minutes you want.

You may need to go to the settings tab as well, and enable the
"Only start this task if the computer has been idle for at least".

In the "If the computer has not been idle that long, retry for
up to:" select 0 minutes.


Alternatively, create the task using SCHTASKS.exe, like this (one
line that will wrap over two lines in this post):

SCHTASKS.exe /Create /RU "%COMPUTERNAME%\Administrator" /RP xxx
/SC ONIDLE /I 30 /TN "IdleLogoff" /TR "C:\myshutdown.bat"

Run the command in a command prompt (cmd.exe) so you see any
messages from SCHTASKS.

You will need to replace xxx with the password for the user
specified after /RU, or use * to be asked for the password.

Using the command above, the task will be configured to kick
in when the computer have been idle for 30 minutes, and it will
then start the batch file C:\myshutdown.bat

Who would start the process/task to log off the user?

Your script (that is started by the scheduled task).
 
J

JC

Ok, thanks for your answer.

I've seen some of the tools you mention, but I didn't understand how to
"catch" the event "the PC has been idle for X time" on a client. How would I
do that? Who would start the process/task to log off the user?

Thanks,
Juan Carlos
 
T

Torgeir Bakken \(MVP\)

JC said:
Thanks a lot. I could solve it with your help.

Great :)

I used "Cmdow" with the "/CLS" and "/END" options,

"/CLS" and "/END" is more an OR than AND (you should use only
one of them) if I am not mistaken.
 
J

JC

Thanks a lot. I could solve it with your help.
I used "Cmdow" with the "/CLS" and "/END" options, and "psshutdown" with the
"-o" option, and a task that executes the script when idle.

Juan Carlos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top