<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dave Amenta .com &#187; Winlogon</title>
	<atom:link href="http://www.daveamenta.com/tag/winlogon/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.daveamenta.com</link>
	<description>(dot (at dave daveamenta) com)</description>
	<lastBuildDate>Tue, 31 Jan 2012 17:22:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get to your Windows desktop faster &#8211; secure automatic logon.</title>
		<link>http://www.daveamenta.com/2009-09/get-to-your-windows-desktop-faster-secure-automatic-logon/</link>
		<comments>http://www.daveamenta.com/2009-09/get-to-your-windows-desktop-faster-secure-automatic-logon/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 22:09:52 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Winlogon]]></category>

		<guid isPermaLink="false">http://www.daveamenta.com/?p=114</guid>
		<description><![CDATA[The common advice for automatically locking the computer after logging in is to create a batch file and add it to the startup folder. Unfortunately the experience isn&#8217;t very elegant, or secure. The desktop and shell will appear while applications are loading, long before the computer will lock itself. The possibility exists for someone to [...]]]></description>
			<content:encoded><![CDATA[<p>The common advice for automatically locking the computer after logging in is to create a batch file and add it to the startup folder.  Unfortunately the experience isn&#8217;t very elegant, or secure.  The desktop and shell will appear while applications are loading, long before the computer will lock itself.  The possibility exists for someone to tamper with the computer while it is in this intermediate loading state.</p>
<p>A solution to this problem is to lock the computer sooner in the logon process.  There are several good places within the logon process to put a task, but the one that may execute the soonest is certainly Userinit.  Userinit is the first program which is executed after logon.</p>
<blockquote><p>From MSDN:  http://msdn.microsoft.com/en-us/library/aa378750(VS.85).aspx</p>
<p>Userinit.exe is an application that is executed when the user has logged on. It runs in the newly logged-on user&#8217;s context and on the application desktop. Its purpose is to set up the user&#8217;s environment, including restoring network uses, establishing profile settings such as fonts and screen colors, and running logon scripts. After completing those tasks, Userinit.exe executes the user shell programs. The shell programs inherit the environment that Userinit.exe sets up. The specific shell programs that Userinit.exe executes are stored in the Shell key value under the Winlogon registry key.</p></blockquote>
<p><strong>Add the lock command to Userinit</strong></p>
<p>Create a batch file that will lock the computer:</p>
<blockquote><p>rundll32.exe user32.dll,LockWorkStation</p></blockquote>
<p>Name the file lock.bat and place it in the System Root.  (c:\windows\system32).</p>
<p>Open regedit and navigate to:</p>
<blockquote><p>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon</p></blockquote>
<p>The registry value Userinit should contain the path to Userinit.exe</p>
<blockquote><p>C:\Windows\system32\userinit.exe</p></blockquote>
<p>Change the value to contain the lock batch file <em>before</em> the Userinit.exe, with a comma between.</p>
<blockquote><p>C:\Windows\System32\lock.bat, C:\Windows\system32\userinit.exe</p></blockquote>
<p><a href="http://www.daveamenta.com/wp-content/uploads/2009/09/reg_lock.png"><img class="size-large wp-image-116" title="reg_lock" src="http://www.daveamenta.com/wp-content/uploads/2009/09/reg_lock-1024x555.png" alt="Windows Registry at Winlogon key" width="500" height="275" /></a></p>
<p>Log off to see the result.  Note that using a batch file does not discriminate between automatic logon, and user-initiated logon.  One could write a program that would only call LockWorkStation if the computer was up for less than 10 minutes.</p>
<p><strong>To enable automatic logon</strong></p>
<p>If automatic logon isn&#8217;t already enabled, execute <strong>control userpasswords2</strong> at the Run prompt, and uncheck <em>Users must enter a username and password to use this computer</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.daveamenta.com/2009-09/get-to-your-windows-desktop-faster-secure-automatic-logon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

