I have been asked to investigate some functionality for a number of shared PCs running Win7 on a local network. Basically people are logging on to the PCs and locking them in the morning and walking away (saving them), making them unusable for other users.

What I would like is a program/script that will allow a user to lock a PC as normal (Ctrl Alt + Del), however it will then unlock itself and log-out after 30 minutes. Ideally a timer on screen counting down from 30 minutes, this way other users would know when to return to the PC to gain access.

The way I imagine this working is as follows;

  • current user locks pc and is warned it will unlock after 30 minutes
  • screen is locked, displaying a countdown
  • when countdown ends the PC unlocks and forces logs off

I'm not sure how to even approach this issue therefore I am open to suggestions, direction and software recommendations.

Note, all user accounts are managed (by an admin) via Active Directory. I would like to keep this function seperate from any user group policies and AD changes if at all possible.

  • Are they walking away and locking them or just walking away from them and the current setting is to automatically lock them after 30 minutes? There seems two elements to this problem. The first is the person problem, this should be addressed, because once the computer is locked any script we could provie you wouldn't work. The second element is your current configuration does not allow multiple users to be logged in at once. – Ramhound May 21 '15 at 14:28
  • Hi @Ramhound they are locking them and walking away keeping the PC 'theirs' for as long as it's locked. The person problem is difficult to control, there is no way of stopping people locking the PCs. This is why we feel like forcing a log off after 30 minutes of it being locked will help. – jonboy May 21 '15 at 14:35
  • The person problem is easy to solve. When it happens grab a foam bat smack the person of the over the head for using the computer and not logging out. I am kidding on that front but if you make it an issue, that is taken seriously, it will not happen. Honestly instead of locking the computer have you consider setting the policy to log them out automatically? I know you want to avoid that solution but that solves the problem and once people learn to save their work it solves the people problem. – Ramhound May 21 '15 at 14:37
  • Hi johnny_s. Software recommendation questions unfortunately are off topic on Super User, however this might be a reasonable question on our sister site Software Recommendations. Consider "flagging" your question for moderator attention and requesting migration. – a CVn May 21 '15 at 14:37
  • @Ramhound I like the stick idea! Maybe my question wasn't clear enough I have added a little. They are login in and then locking the PCs. I would like the PC to unlock itself and logout after 30 minutes, displaing how long is lef until forced logout. – jonboy May 21 '15 at 14:45

Here is the solution using Task Scheduler. No fancy countdown, though.

A scheduled task named "Log Off Idle Session", set to run when the user logs on or when the system goes idle, and with Conditions set to run only if idle for 30 minutes. It's set to run only when user is logged on and [ ] Run with highest privileges is checked.


According to the documentation, the Task Scheduler checks for "idle" condition every 15 minutes, so you can't expect it to run reliably at 1 minute.

1 2 3 4 5 6

  • 1
    thanks @beatcracker if only I could get my fancy countdown working! – jonboy May 21 '15 at 16:08

protected by Community Feb 15 '16 at 12:27

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.