Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Does the following meet your requirements?</p> <pre><code>start logon.scr /s </code></pre> <p>As long as the <code>.scr</code> is on the PATH the above command should work.</p> <p>EDIT: I don't know if Windows 7 comes with <code>logon.scr</code>, make sure you're testing it with a <code>.scr</code> that is actually installed in Windows 7.</p> <p>Note that I got the idea of just invoking the <code>.scr</code> with <code>/s</code> from <a href="http://msdn.microsoft.com/en-us/library/ms686421.aspx#ss_cmdline" rel="nofollow noreferrer">Screensaver Sample Command Line Options</a>:</p> <blockquote> <p>When Windows runs your screensaver, it launches it with one of three command line options:</p> <ul> <li>/s – Start the screensaver in full-screen mode.</li> <li>/c – Show the configuration settings dialog box.</li> <li>/p #### – Display a preview of the screensaver using the specified window handle.</li> </ul> </blockquote> <p>EDIT 2:</p> <p>I did some additional searching and found that you could create <code>lock.cmd</code>:</p> <pre><code>@start /wait logon.scr /s &amp; rundll32 user32.dll,LockWorkStation </code></pre> <p>Or <code>lock.vbs</code>:</p> <pre><code>Set objShell = CreateObject("Wscript.Shell") ' The "True" argument will make the script wait for the screensaver to exit returnVal = objShell.Run("logon.scr", 1, True) ' Then call the lock functionality objShell.Run "rundll32.exe user32.dll,LockWorkStation" </code></pre> <p>Neither of these answers is perfect, both reveal a flicker of the desktop after the screen saver is disabled and just prior to the workstation being locked.</p> <p>It may not be possible to reproduce the system behaviour of starting the screen saver and password protecting on resume. Even <a href="https://stackoverflow.com/questions/267728/267735#267735">the answer to Launch System Screensaver from C# Windows Form</a> only starts the screen saver, it does not password protect on resume.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload