Link to home
Start Free TrialLog in
Avatar of CousinDupree
CousinDupreeFlag for United States of America

asked on

How do I force Windows 7 startup to finish before logon is allowed?

I am trying to get my Windows 7 workstations to wait until all the Startup policies have finished before allowing the user to logon.  My Windows 7 workstations don't behave this way.  To test this I've created a group policy that runs the following script:

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objOutput
Set objOutput = objFSO.CreateTextFile("C:\Test.txt", True)
objOutput.WriteLine(Now() & " - Sleeping for 5 minutes.")
WScript.Sleep 300000
objOutput.WriteLine(Now() & " - Finished sleeping.")
objOutput.Close

When the workstation is started, the logon screen is presented immediately.  If I log on and check the file that the script creates, only the first line appears.  The second line appears 5 minutes later.

How can I force Windows 7 workstations to wait until all startup wscripts are finished before allowing a user to logon?  I've enabled the 'Always wait for network at computer startup and logon", which didn't help.

ASKER CERTIFIED SOLUTION
Avatar of Joseph Moody
Joseph Moody
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CousinDupree

ASKER

I don't have it enabled.

Description of the Windows XP Professional Fast Logon Optimization feature
http://support.microsoft.com/kb/305293

Still applies to Win7, also helps to explain why the behavior is the way it is.....
It turns out that Jmoody10 was on the right track.  In Windows 7, you need to set  'Run Startup Scripts Asynchronously' to disabled to get startup scripts to run synchronously.  Previous versions of Windows ran startup scripts synchronously by default, but Windows 7 runs them asynchronously by default.  Setting 'Computer Configuration->Policies->Administrative Templates->System->Scripts->Run Startup Scripts Asynchronously' to 'Disabled' fixed my issue.  Setting the policy setting to 'Not Configured' did NOT work!