Command line to lock Windows 7 PC

For security reasons, I would like my PC to lock after I walk away from it.
I have a problem where on of Windows 7 PC’s doesn’t start the screensaver (which I have set to require me to log back in).

Yeah I can hit windows+L to lock my PC, but I forget sometimes (like when I go home for the weekend).

So I setup a schedule task to run the following command:

%windir%\System32\rundll32.exe user32.dll,LockWorkStation

The task runs every day after 5:30 PM, so my PC will always end up locked.

[tweetmeme only_single=”false”]
Advertisements

7 thoughts on “Command line to lock Windows 7 PC

Got something to add?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s