Computers running Microsoft Windows can be locked at any time by holding down the Windows key on the keyboard and pressing L. The current user's password must then be entered to resume using the computer.
Computers may also be set to lock automatically when the screen saver activates after a set period of inactivity. On Windows 7, proceed to the Start Menu, then to the Control Panel. Click the Personalization menu option, and then define the inactivity period in minutes in the Wait field. Click the checkbox for On resume, display login screen, and then click OK. The computer will then lock itself when there is no keyboard or mouse input for the specified length of time.