# Windows 7 sometimes hangs during shutdown



## FlyingPenguins (Jul 2, 2006)

I am using Windows 7 Pro 64-bit. Since the last two weeks, I've noticed that occasionally, while shutting down Windows, it will stall at the "Shutting Down..." message, and the computer will never actually power off. I have to resort to manually shut turn off the power. This only occurs once during every 5-10 shutdowns or so, not every shutdown.

I tried shutting down from Safe Mode eight times as a test, and the problem didn't occur. Nothing unusual appears in the Event Viewer.

The only thing I can think of at the moment that could've caused this was when I was installing updates via Windows Update (within Windows itself, not while shutting down the computer). The update installation stalled for more than an hour, clicking cancel didn't stop the process, and I had to restart the computer to get it to stop. Is this the probable cause? How can I resolve this issue?


----------



## Hchristophercun (Mar 24, 2012)

It's having trouble closing a service. Did you install some strange application that required that a service be added within the past 2 weeks?


----------



## Logan_Albright (Mar 26, 2012)

Could be a faulty driver. Try unplugging devices one at a time, and restarting until it goes away.


----------



## FlyingPenguins (Jul 2, 2006)

@Hchristophercun: Program installations that require services? Can't think of any since the problem started occurring, unless Adobe Air or Microsoft Games for Windows Live Redistributable installs services.

@Logan_Albright: I haven't plugged in any new, unrecognized devices to my computer for a while, or upgraded drivers for those that were already regularly plugged in. Still possibly could be an issue with drivers, though diagnosing drivers to see which one is causing the problem would get very tedious.


----------



## Hchristophercun (Mar 24, 2012)

I switched.over to 64 bit the other day and I found some of the applications aren't fully comparable. my guess is that adobe air is hijacking you wifi and you need the correct version.


----------



## shawnpb (May 30, 2010)

Could be the logoff sound. Try going to Control Panel>Sounds locate the logoff sound or shutdown sound then click on none. Reboot and see if this speeds up shutdown.


----------



## Tomken15 (Dec 7, 2011)

I occasionally get the log off sound delay and is normally on a reboot following a driver update, but with that you get the option to do a forced shut down to close the application and I've never had a freeze with/without that delay although there have been times when it seemed to take longer than normal to shut down, but eventually got there on its own.

If it is a driver problem (and that is a possible cause as given in my previous link), then that may be highlighted with a yellow alert in Device Manager.


----------



## FlyingPenguins (Jul 2, 2006)

Hchristophercun said:


> I switched.over to 64 bit the other day and I found some of the applications aren't fully comparable. my guess is that adobe air is hijacking you wifi and you need the correct version.


Hmm. The version of Adobe Air should be correct. Not using wifi, though...



JackBauer_24 said:


> Could be the logoff sound. Try going to Control Panel>Sounds locate the logoff sound or shutdown sound then click on none. Reboot and see if this speeds up shutdown.


I've disabled logoff & shutdown sounds for now... I'll do a couple shutdown tests later today and give an update.



Tomken15 said:


> I occasionally get the log off sound delay and is normally on a reboot following a driver update, but with that you get the option to do a forced shut down to close the application and I've never had a freeze with/without that delay although there have been times when it seemed to take longer than normal to shut down, but eventually got there on its own.
> 
> If it is a driver problem (and that is a possible cause as given in my previous link), then that may be highlighted with a yellow alert in Device Manager.


There are no yellow alerts under any of the devices in the Device Manager.
Also, I should mention that when the problem occurs, the only thing unusual that appears in the Event Viewer is a critical Kernel-Power one: "The system has rebooted without cleanly shutting down first. This error could be caused if the system stopped responding, crashed, or lost power unexpectedly.", caused by me manually forcing a power off.


----------



## shawnpb (May 30, 2010)

You may have caused errors.

First go to Start type in CMD locate CMD.exe right click on it then select "Run as administrator"

At the command prompt type in...

CHKDSK /R
type Y for Yes reboot.


----------



## Tomken15 (Dec 7, 2011)

chkdsk /r is not recommended unless the user is fully confident there aren't any bad sectors on the HDD and it's advocated that chkdsk /f be used instead.

Scroll down to the section "Caution on use of the /R switch" in this article giving the explanations and uses of the chkdsk cmd Chkdsk


----------



## shawnpb (May 30, 2010)

How would you determine there is no bad sectors on the drive unless you run CHKDSK /R? 

Which is totally safe to run btw.


----------



## Tomken15 (Dec 7, 2011)

JackBauer_24 said:


> How would you determine there is no bad sectors on the drive unless you run CHKDSK /R?
> 
> Which is totally safe to run btw.


Although I've never experienced it, I should think the chkdsk /f would report there were files it could not repair, which may suggest there were bad sectors.


----------



## shawnpb (May 30, 2010)

CHKDSK /F only checks disk and repairs if possible disk errors mainly file system errors. /R does a surface check a physical check. If any bad sectors are found it attempt to recover any files with in the bad sectors then move them.


----------



## Tomken15 (Dec 7, 2011)

I know that /R does a surface check and have used it myself, but in the context of this thread, why does he need to do the surface check when it would seem the file check more appropriate and quicker.

I suppose if you are going to be in there, then you may as well do the lot as a matter of routine but if there were bad sectors and /R was unable to repair them, then data could be lost.

He could always do the full scan later with the priority at the moment being to get him up and running again and if that works then there will be no need to do the surface scan.


----------



## shawnpb (May 30, 2010)

I suppose you are right. But 9 out of 10 of us Microsoft Team Members suggest the /R switch if someone is having Windows loading hangs.

Heck I was put on the team for some reason right? Perhaps it is because I give out good advice also solved some problems on here.

All advice is credited on this forum if it is good advice so /f is a good start.


----------



## Tomken15 (Dec 7, 2011)

I would still bow to your superiority and experience on this though :smile::thumb:


----------



## shawnpb (May 30, 2010)

Experience maybe I am not superior lol. And you don't need to bow I am here to help and a team player.

Let's stay on topic thought shall we.


----------



## FlyingPenguins (Jul 2, 2006)

Ran chkdsk twice using the /R and /f switches each. :tngue: No problems were found either way.

I also tested doing shutdowns 10 times. I couldn't reproduce the problem anymore. Maybe disabling the shutdown audio actually helped? I have no idea. Something tells me it's not completely fixed though... but oh well.

btw, thanks to everyone for your input. :smile:


----------



## FlyingPenguins (Jul 2, 2006)

Update: Nope, problem hasn't gone away completely. It occurs during restarts as well.

I may plan to do a clean reinstall of Windows in the next while to fix this, among a couple of other minor problems.


----------



## shawnpb (May 30, 2010)

It could be a number of many things. Back Ground programs that need to be end tasked before shutting down, A lot for processes running which also needs to be end tasked also. Better to narrowing it down by narrowing down your Startup apps in the Msconfig Startup tab unchecking them to see if that helps (except essentials M$ items and anti virus program) Also using Process Explorer and event viewer to narrow it down.


----------



## Tomken15 (Dec 7, 2011)

As you originally said that the problem seemed to arise with a failed Windows update, check Installed Updates to see if any did fail. If there are then you should check Windows Update to see if any are waiting to be downloaded, as once they've failed or the download had been terminated, you don't normally get the alert in the Taskbar or in the Shutdown box.

If there are any waiting to download then first run this MS Windows Update auto fix How do I reset Windows Update components? and if they still hang, then follow the steps in this MS article Unable to install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 as the problem could be "A required system file is registered incorrectly"

That's if you haven't already done the clean reinstall.


----------



## FlyingPenguins (Jul 2, 2006)

JackBauer_24 said:


> It could be a number of many things. Back Ground programs that need to be end tasked before shutting down, A lot for processes running which also needs to be end tasked also. Better to narrowing it down by narrowing down your Startup apps in the Msconfig Startup tab unchecking them to see if that helps (except essentials M$ items and anti virus program) Also using Process Explorer and event viewer to narrow it down.


I already tried disabling some unneeded startup processes, but disabling all but the essentials is worth a shot.



Tomken15 said:


> As you originally said that the problem seemed to arise with a failed Windows update, check Installed Updates to see if any did fail. If there are then you should check Windows Update to see if any are waiting to be downloaded, as once they've failed or the download had been terminated, you don't normally get the alert in the Taskbar or in the Shutdown box.
> 
> If there are any waiting to download then first run this MS Windows Update auto fix How do I reset Windows Update components? and if they still hang, then follow the steps in this MS article Unable to install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2 as the problem could be "A required system file is registered incorrectly"
> 
> That's if you haven't already done the clean reinstall.


That specific update occurrence shows up as "failed" for the two updates I were trying to install. However, upon rebooting and trying to download & install them again, they installed correctly. (Both were non-critical updates: one was a Visual Studio service pack, while the other was for .NET Framework.) In addition, Windows Update still works fine... I can still download & install updates as usual.

I don't plan to do a clean reinstall for a couple of weeks. The issue is not exactly highly problematic, other than having the possibility of the computer unnecessarily wasting power by being on for ~10 hours if I go to bed without making sure that the computer fully powers off (happened at least twice). :tngue: But annoying? Definitely.


A remark: it doesn't seem to be a malware issue. Scanned using Avast!, Malwarebytes, SuperAntiSpyware, Spybot S&D, Windows Defender, Sophos Anti-Rootkit, and GMER, and nothing unusual came up.


----------



## shawnpb (May 30, 2010)

Tomken15 said:


> Have a read through Speed Up Very Slow Computer Shutdown to see if any of the steps will be beneficial.



We can not and do not offer advice about registry cleaners or boosters in the Microsoft Support Forum they are a bad idea.


----------



## Tomken15 (Dec 7, 2011)

JackBauer_24 said:


> We can not and do not offer advice about registry cleaners or boosters in the Microsoft Support Forum they are a bad idea.


Thanks for pointing that bit out Jack (missed it), the only prog that I will trust to intelligently clean my registry now and again, is my Norton 360 and I've never had any problems with that so far.


----------



## shawnpb (May 30, 2010)

Are Registry Cleaners Safe to Use? - Chris Pirillo


----------



## Tomken15 (Dec 7, 2011)

JackBauer_24 said:


> Are Registry Cleaners Safe to Use? - Chris Pirillo


A good article and I agree about CCleaner. If you don't know what the entries relate to then you should leave well alone.

In addition to Norton 360 I will use ASC5 to clean Obsolete History and Invalid file paths that Norton doesn't pick up on, but also use this prog WinMend Registry Defrag - Free windows registry defrag software. to defrag the registry as there's no point in cleaning bits out if you're not going to compact it.


----------

