This turned out to be a bit of a saga with several missteps along the way. Rather than just present the solution and appear cleverer than I am here's the full story on the principle that it can sometimes be as helpful to describe what didn't work as well as what finally did work. First I'll set the scene...
My main PC (Windows 7 Ultimate x64) had recently decided to take much longer than usual progressing from the Password screen to the Desktop. Sometimes it would be quick enough but sometimes it might take over a minute. Initial scrutiny of the Event Log showed that Windows was seeing the delay but not providing anything definitive about the cause.
For the full horror story read on or, if you want to find out how it ended, you can just skip to the penultimate paragraph.
My first thought was to run "CHKDSK C: /f /v" and "SFC /ScanNow" from an elevated Command Prompt but no errors were found and startup performance remained unchanged.
Then I used cCleaner
to clear out some unnecessary startup programs, also to no avail. By the way, Microsoft's own "System Information" app is worse than useless at telling you what runs on your system at Startup.
Given that this is recent behaviour the obvious candidates are software updates (Microsoft or third party) or an impending hardware issue. I discounted the latter because once the Desktop is up and running the computer can run as normal all day without further issues.
Anyway, I then "hid" the problem by applying a Registry "band aid". I added the 32 bit DWORD value "DelayedDesktopSwitchTimeout" to the key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" and set its value to 5 (seconds). This fix is described in Microsoft's KB940452
for a slightly different issue but it worked for me in that I got to the Desktop in a reasonable time. As for why the band aid works, there are a number of Google results
when searching for DelayedDesktopSwitchTimeout
. None of them seem to relate directly to my problem but when one reads that even something as trivial as setting the Desktop background to a solid colour can induce a thirty second delay in progressing through the "Welcome" screen one wonders exactly what sort of hallucinogenic substances the Microsoft programmers may enjoy during working hours.
The trouble with band aids is that you don't know whether the wound has healed until you remove them so a couple of hours later, and after an hour of vigorous exercise which pumped an extra red corpuscle or two through the little grey cells, I decided to use cCleaner's "Cleaner" tab at it's default settings, apart from disabling the removal of my Firefox cookies, and it cleared out 484MB of "stuff".
Then I removed the "DelayedDesktopSwitchTimeout" value from the Registry and rebooted. Restarted a couple of times and the transition from password entry to Desktop display took about 12 seconds. Success, I thought, until this morning when it took well over a minute to get from Password entry to the Desktop.
So it was back to the Event Viewer to try and see what was going on. I created a Custom View to show me all
Critical and Warning events. No critical events were showing up but I was seeing a lot of "Error 0x80070002 occurred while verifying known folder" events (ID: 1002) at each start up, those errors first appearing back in September. These errors were confined to subfolders of "C:\Windows\system32\config\systemprofile\". Firing up Windows Explorer and enabling viewing of System Folders allowed me to drill down and find that, indeed, none of the folders being complained about actually existed. My next port of call was the Registry where I found matching references to each missing folder under two "FolderDescriptions" keys, one for 32 bit and one for 64 bit. Bravely, and with the benefit of too little knowledge
, I decided that these Registry entries needed removal so that's what I did, including removal of all references to those entries but not
before I created a manual Restore Point. On the next restart the computer progressed from Password to Desktop in good order so I though "problem solved". Mistake!
Another look at the Event Log showed the same error messages so it would seem that Windows has these folder paths stored for use when the registry entries are missing. A System Restore to the manually created restore point undid all the registry deletions I had made. Then I did the simple thing (finally!) and just created new Folders to match the ones that the Event Log was complaining that Windows couldn't verify. The only extra step I took as I created each one was to assign ownership to the Administrators to match the ownership of the parent "systemprofile" folder - I'm not sure whether that step was necessary but it seemed prudent.
By the way, cCleaner is an excellent tool but like all sharp objects it should be handled with care and lots of thought - "measure twice and cut once". Similarly, making changes to the Registry should only be done if you are 100% confident in the changes you are making.
as though that last step has finally solved the problem. The last four restarts have got me from Password to Desktop in about twelve seconds each time and the Event Viewer is no longer complaining that it can't verify the previously missing folders. Of course those manually created folders aren't "special" insofar as their Properties are concerned but as they don't contain any files, and probably never will, I'm not going to worry about it. If tomorrow morning's start up is also normal I can relax. If it isn't then I'll be back to the drawing board, albeit with a few less event warnings to worry about, and I'll be adding to this already over-long post!
Oh dear, here I am again after another long one. The frustration is that these long startup times are intermittent so I can never be sure when the issue is sorted. I cleaned out the /Windows/Prefetch folder this evening: too early to be sure but I don't think that has helped. Next stage will be to uninstall Kaspersky's ISS, reboot and then reinstall it. If that doesn't help then I'll be uninstalling NVidia's driver and installing the next version which ahas just been "qualified".
Well, I'm back again so you know that everything I've done so far was rubbish!
Well, not completely but it didn't solve the problem. But I had a major clue a couple of days ago when I decided to upgrade to the latest (qualified) NVidia graphics driver. When I do a manual graphics driver update I like to create a temporary Administrator account to avoid issues with my very complicated Desktop as the screen resolution changes. So after creating the temporary account I did a few Restarts into that account both before and after the graphics driver update and I was still seeing a slower than desired progression from Password to what was now a very simple Desktop on the temporary account. That was a big clue as there is very little major software that loads up during start irrespective of the User who logs on. Suspicion now fell squarely at the door of Kaspersky ISS 2011 but first I deleted that temporary account.
With Kaspersky ISS 2011 now firmly in the spotlight I uninstalled it completely (except for the Activation code) and rebooted. Voilà, straight from Password to my Desktop in about three seconds and I did another Restart just for confirmation. As I still have over six months to go on the Kaspersky licence I then reinstalled it. Installation seemed to go well and, as expected, it then asked for a Restart to complete. Again all went as expected and I wasn't interested in timing things at this stage with Kaspersky still settling down. Once at the Desktop I initiated a Kaspersky update. That went well enough and once it was flagged as "Complete" I did another Restart. Password to Desktop took about a minute after which Kaspersky blared out that its databases were obsolete. Bizarre given it had just Updated. Anyway, another Update and a manual Restart and things seem to be more normal though I'm puzzled as to why it seems to be so busy over the Internet immediately after Password entry as I don't allow it to check for updates during the first eight minutes after startup. The net result is that Kaspersky is on a very shaky ground with me on the credibility stakes right now - certainly if I see my Password to Desktop time misbehaving again it's out of here never to darken my door again. And when the licence runs out renewal is certainly not
With hindsight maybe the solution should have been more obvious but there again why should I immediately suspect a program that has worked without particular issue for a long time? Reading the earlier parts of this post again I think the only significant mistake I made was in trying to edit out those "FolderDescriptions" registry entries. As for the rest, while they weren't actually relevant to the problem some of the actions I took may even have done some longer term good. In any event I certainly hope that my journey may be of help to anyone else who starts to see the same problem.
Kaspersky ISS 2011 is now removed - guess why!
I've decided to continue the ISS conversation in the new thread Which Security Suite/Anti-virus package do you use?
Like all intermittent problems one can never be sure a solution has been found unless there's an obvious smoking gun and it turned out that the fix above nudged things in the right direction but the problem did come back to haunt me. However I'm hopeful that the latest solution, namely to change the Bonjour service from "Automatic" to "Delayed Automatic" may have finally put this issue to bed.