Helping people with computers... one answer at a time.

If you leave something sensitive on your display and then walk away, anyone can see it. There are steps you should take if that's a potential problem.

Do have any idea how to force the computer to log off? The situation is that at work people don't log off and leave sensitive information on their screen.

It's funny, I ran into exactly this situation years ago. I was walking by my boss's office and happened to see some interesting information on his screen. Some very interesting information.

It was performance review time, and on his screen was a spreadsheet with all the review and salary information.

Needless to say when he got back we solved that problem quickly, and the same solution might well apply here.

The quickest solution: enable a screen saver, and ensure that "On resume, display Welcome screen" is selected:

Screen Saver settings

After the screen saver kicks in when the user returns to their computer they'll be presented with the Windows login screen. Assuming their account has a password, they'll have to enter the password to return to whatever it was they were doing and see whatever it was they had on their screen.

It's not a true log-off, but it does solve the problem of anyone walking by being able to see or access what's on the computer. And it's exactly the solution my boss implemented on his own machine.

(And, no, pointing that out to my boss didn't hurt or help me in that performance review :-) )

"The quickest solution: enable a screen saver"

If you want to force a true log-off, I'm not aware of a way to make it happen on inactivity, but then you probably don't want it to happen that way anyway. A true log-off will close all open applications and possibly lose any unsaved data that the user had in those applications.

I do, in one case, force a log off on one of my machines in the middle of the night. I do that by using the "psshutdown" command:

psshutdown -o -f

"-o" logs off the console user, and "-f" forces any running applications to close. Psshutdown is one of the sysinternals utilities and can be downloaded here.

Using the task scheduler one could schedule psshutdown to be run at a specific time each night, for example, to force a logoff. That doesn't solve the problem during the day, but it does force the log off.

Article C3019 - May 9, 2007 « »

Share this article with your friends:

Share this article on Facebook Tweet this article Email a link to this article
Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

George Arauz
May 10, 2007 5:03 AM

Does this work with Mac's as well?

Thierry Delettre
May 10, 2007 8:03 AM

There is a very similar way to do the same thing on a Mac (with Mac OS X 10.4) : go to System Preferences/Security and check the 'Require password to wake this computer from sleep or screen saver' box.
You can add something : in Utilities/Keychain Access, open the Preferences and check 'Show status in menu bar'. It will allow you to open the screen saver from the menu bar.

Dan Ullman
May 10, 2007 9:07 AM

Er, Leo. You might want to reread what you put it bold face type...

Dan Ullman
May 10, 2007 9:08 AM

er, IN not IT :)

Dominick Franzini
May 12, 2007 12:34 PM

Wow -- sorry about those typos:

Another 2 cents: The WinExit screensaver (I believe part of the WinNT4 or Win2k resource kits) will log the user off after a configurable period of inactivity. I've used it in a few applications of shared computers. Not sure if it's compatible with WinXP.

Eli Coten
May 12, 2007 4:14 PM

I managed to get it to force a logoff. It involves a registry edit but there is a key in the registry that controls the screensaver. Edit the screensaver.scr entry (Somewhere in the Users's settings\Control\Desktop key) and make it point to A SHORTCUT or BATCH FILE.

In the shortcut or batch file, type in "shutdown -l" and if you have done it correctly, after the specified screensaver delay the user will be logged off.

You cannot put "shutdown -l" straigth into the registry, I don't know why but I tried it myself and it didn't work.

Also this is a forced logoff so any unsaved work WILL be lost. If you use this trick do not leave the computer with anything unsaved otherwise it will be lost.

Hope this is helpful,

October 14, 2008 12:33 PM

Hi Leo, why wouldn't you just use the "Window" "L" command to take you straight to the Log In screen? Its so simple and at least gives you the first layer of protection and it is immediate, i.e. you don't have to wait for a Screen Saver . Certainly your boss could and should have used it! Mike.

a) you have to remember to do it, and b) my example actually pre-dates the Windows key :-). Ctrl+Alt+Del might have done it at the time, but again - you have to remember to do it. Distraction is a problem.
- Leo

October 22, 2009 9:10 PM

There's this free third pary tool called Romaco Timeout which allows you to force a true logoff or shutdown after a specified time. I wrote a short post on the various ways you can use the tool. You can check it out here if you like.

Comments on this entry are closed.

If you have a question, start by using the search box up at the top of the page - there's a very good chance that your question has already been answered on Ask Leo!.

If you don't find your answer, head out to to ask your question.