How to lock Windows screen on startup?

1

1

I like to go get coffee while the computer starts. However we have a policy that says the screen must be locked when away.

How can I make sure that the screen locks immediately after logging in?

nute

Posted 2013-07-02T06:31:31.677

Reputation: 1 459

Question was closed 2015-01-21T21:38:38.967

Answers

6

Try

RUNDLL32 USER32.DLL,LockWorkStation

http://www.robvanderwoude.com/rundll.php

You can create a Shortcut to the c:\Windows\System32\rundll32.exe and add the parameter. If you put this shortcut in the Autostart folder, your computer will be locked after login.

Screenshot is german, but the shortcut target should look like this, (verified with Windows 8 but should work with Windows 2000+)

shortcut

Jürgen Steinblock

Posted 2013-07-02T06:31:31.677

Reputation: 318

+1, I used to use this to lock my XP workstation from RDP sessions. – deed02392 – 2013-07-02T09:41:38.727

2

-1. Raymond Chen/The Old New Thing: What can go wrong when you mismatch the calling convention?: *"[The function signature required for functions called by rundll32.exe is documented in this Knowledge Base article.] That hasn't stopped people from using rundll32 to call random functions that weren't designed to be called by rundll32, like [user32 LockWorkStation] or [user32 ExitWindowsEx]."* Besides, rundll32 is deprecated since Vista.

– a CVn – 2013-07-02T09:53:30.577

@Michael, didn't know about that, thanks. Raymond has a good point and here are some more reasons why not to use rundll http://blogs.msdn.com/b/oldnewthing/archive/2013/01/04/10382242.aspx and as a programmer it makes sense to say Don't use it, call the function yourself but as a user it should be more like Use it at your own risk, if it works for you

– Jürgen Steinblock – 2013-07-02T10:30:47.073

@SchlaWiener I might agree, if it wasn't for the fact that as pointed out by Raymond Chen this kind of trick can work intermittently. Working as a programmer, intermittently occuring bugs are the ones I loathe the most trying to track down. And I don't want to think about what calling (random) Win32 API functions with random parameters could potentially do to application state. If I feel like it later today or this weekend, maybe I'll put together a small application that simply calls LockWorkStation as it was intended to be called, and put it somewhere for everyone's benefit. – a CVn – 2013-07-02T11:42:02.153

seems to work for me! – nute – 2013-07-02T12:54:27.233

1

If I am not mistaken, when you disable auto login the lock screen will be automatically activated.

matan129

Posted 2013-07-02T06:31:31.677

Reputation: 1 914

2But that will prevent the "preloading" of apps that are run at first login (mail client, browser) – Jürgen Steinblock – 2013-07-02T07:23:06.847

Right. I have another idea in mind, I will think about it – matan129 – 2013-07-02T07:24:19.647

Well I thought about launching the executable in system32 which locks the computer, and apparently it's rundll32 - and SchlaWiener gave you great answer. – matan129 – 2013-07-02T07:44:47.400

0

I copy the following from http://www.sevenforums.com/general-discussion/293057-how-do-i-completely-remove-user-lock-screen-when-i-boot-up.html:

http://s8.postimg.org/ohlejdscz/image.jpg

To lock, choose Require a password (recommended). I see that this does NOT state 'Lock' explicitly, but once you choose this, your home screen will become Locked, even without a password.

Greek - Area 51 Proposal

Posted 2013-07-02T06:31:31.677

Reputation: 1 024