Automatically log off inactive users in Windows 10
December 20, 2015 3 Comments
Although I use Linux on my own machines, the family PC in my lounge runs Windows 10. It has five user accounts and the other members of my family never bother to log out (‘sign out’ in Windows 10 parlance), usually leaving a browser window open. If I logged in to my account and clicked on my icon in the top left corner of the Start Menu, ‘Signed in’ was shown below any of the other users who had not bothered to log out. I found this behaviour somewhat frustrating and resolved to configure the PC to log out a user after a specified period of inactivity by that user. Although it is generally not recommended to forcibly logout someone in case e.g. they have a document open, in my family’s case it would be unlikely to cause a problem and is preferable to leaving several accounts unnecessarily active (albeit requiring each user to re-enter their password in order to access the account, as the default setting for ‘Require a password on wake-up’ is ‘Yes’). Below I explain how I configured Windows 10 to log out each user automatically after a period of inactivity.
First I downloaded the application
idlelogoff.exe using the following link:
See the Web page Automatically log off inactive users for details of that application.
I used the Windows 10 File Explorer to copy the file to the root directory
C:\ and then I created a batch file
IDLELOGOFF.BAT by right-clicking on the Windows 10 Start Menu icon, selecting ‘Command Prompt (Admin)’ and entering the following commands in the Command Prompt window:
I made the contents of the batch file
IDLELOGOFF.BAT the following, so that a user would be logged out automatically after 900 seconds of inactivity in their session:
start /min C:\idlelogoff.exe 900 logoff
and I changed the owner of the batch file to Users by right-clicking on it in File Explorer and then clicking ‘Properties’ > ‘Security’ > ‘Advanced’ > ‘Owner: Change’ and specifying ‘Users’.
Then I created a standard shortcut to the batch file for each user by getting each user in turn to log in to their account and following the instructions on the Web page Windows 10 – How to Run Program Automatically at Startup. Basically, you press the Windows Key and the R key simultaneously and enter ‘
shell:startup‘ to open the user’s Start-up folder, and from there you right-click and select ‘New’ > ‘Shortcut’.
After that, the application
idlelogoff.exe should be started automatically the next time a user logs in. You can check by pressing Ctrl-Alt-Delete in each user’s session, selecting ‘Task Manager’, clicking on the ‘Processes’ tab and
idlelogoff.exe should be in the list of background processes. If you then log in to your own account and click on your account icon in the top left corner of the Start Menu, you’ll notice ‘Signed in’ is shown below the other user’s icon. If you check again after fifteen minutes, you’ll see that the ‘Signed in’ has gone, indicating that the user has been forcibly logged off.