The Big Picture: Closing a Shop for the Night
Closing a shop properly means: tell customers to leave, finish serving them, count the till, switch off the machines, lock the door. Closing it badly means walking out mid-sale with the lights on.
A PC does the same. A graceful shutdown lets every program and service finish its work and save its data before the power goes off. This section covers the three things the Start menu offers: Shut down, Restart, and the hidden twist in "Shut down" called Fast Startup.
6.1 Graceful Shutdown Sequence (Services Stop, Processes End)
What it is: When you choose Shut down or Restart, Windows runs an orderly sequence. Section 11 draws the whole chain; here are the key steps.
| Step | What happens |
|---|---|
| 1. Request | You click Shut down. The request is handled by the logon/session components (winlogon.exe) and a call named ExitWindowsEx |
| 2. Warn programs | Each open program gets a message: "the session is ending, please close". Programs can save work or show "Save changes?" |
| 3. Wait or force | Windows waits a short time for slow programs, then offers "Close anyway" (or closes them if forced) |
| 4. Log off the user | The user's session ends; their processes are closed (Chapter 9) |
| 5. Stop services | The Service Control Manager tells services to stop, in dependency order (Chapter 12) |
| 6. Flush to disk | The kernel writes cached data to the drive so no file is left half-written (Chapter 19) |
| 7. Power IRPs | Drivers are told to power down their devices (Chapter 13) |
| 8. Power off | ACPI switches the machine to S5 (Section 2) |
Why it can take time: a program that does not respond, a service that will not stop, or a large amount of data to flush each add delay. If you see "Waiting for..." on a blue screen during shutdown, Windows is waiting for such an item.
Why a hard power-off is bad: if you hold the power button for several seconds or pull the plug, the flush in step 6 never happens. Files being written can be damaged. Modern file systems (Chapter 19) have a journal that helps repair this, but you can still lose recent work.
6.2 Shut Down vs Restart vs Sign Out
| Action | What it does | Ends in |
|---|---|---|
| Sign out | Closes your session only; the PC and services keep running | Login screen |
| Restart | Closes everything, shuts the kernel down fully, then boots again from scratch | New full boot |
| Shut down (default) | Closes sessions, then may save the kernel (Fast Startup) and powers off | S5 |
| Shut down with Shift held | A full shutdown, without Fast Startup | S5 |
| Sleep / Hibernate | Keeps your session (Sections 3 and 4) | S3 / S4 |
Why Restart fixes problems: Restart really clears the kernel and all drivers from memory and loads them fresh. Plain "Shut down" with Fast Startup does not do that (see 6.3). That is why "have you tried restarting?" works, and why "I shut it down and turned it on" sometimes does not.
6.3 Fast Startup (Hybrid Shutdown)
What it is: Fast Startup (also called hybrid shutdown or hybrid boot) is a Windows 10 and 11 feature, on by default on many PCs, that makes the next start quicker.
When you click Shut down with Fast Startup on:
1. All user sessions are logged off, user programs closed (like a normal shutdown)
2. The KERNEL SESSION is NOT closed. Windows hibernates it:
kernel + loaded drivers' state ---> hiberfil.sys
3. The PC powers off (S5)
On the next boot:
power button -> firmware -> boot manager -> sees saved kernel
-> loads it from hiberfil.sys (fast) -> logon screen
So it is a partial hibernate: your programs are not saved (they were closed), but the kernel and drivers are. Reading one file is quicker than starting the kernel and loading every driver one by one, especially on a hard drive.
| Full boot | Fast Startup boot | |
|---|---|---|
| Programs | Closed | Closed |
| Kernel and drivers | Loaded fresh | Restored from hiberfil.sys |
| Speed | Slower | Faster |
| Clears driver glitches | Yes | No |
Side effects to know:
| Effect | Why |
|---|---|
| A problem survives a "Shut down" | The faulty driver state was saved and restored |
| Uptime in Task Manager can look very long | The kernel session carries over (Chapter 11); a Restart resets it |
| Some updates seem to wait | Windows may need a real restart to finish them |
| Dual-boot or disk tools may complain | The file system looks "in use" (hibernated) to the other system |
| Wake-on-LAN or some devices behave differently | The PC may be in S5 with the kernel saved |
Fast Startup needs hibernation switched on (Section 4). powercfg /a lists "Fast Startup" if it is available. You can turn it on or off in Control Panel → Power Options → "Choose what the power buttons do" (hedge: the option is hidden if hibernation is off). Do not change it in the lab.
6.4 The shutdown Command (Read About It, Do Not Run It in the Lab)
Windows has a command-line tool named shutdown. It is real and useful, but running it ends your session, so the lab does not use it.
| Switch | Meaning |
|---|---|
/s | Shut down |
/r | Restart |
/h | Hibernate |
/l | Log off |
/t seconds | Wait this long first (/t 0 means at once) |
/f | Force running programs to close (can lose unsaved work) |
/a | Abort a pending shutdown (only works during the countdown) |
/hybrid | With /s, do a shutdown that prepares Fast Startup (hedge: version details) |
An example you might see in a script: shutdown /r /t 60 (restart in a minute). Never use /f casually; it closes programs without letting them save.
Safety: Do not run
shutdowncommands while working through this chapter. Reading them is enough.
6.5 When Windows Restarts for Other Reasons
| Reason | Detail |
|---|---|
| Updates | Installing certain updates needs a restart (Chapter 35) |
| Blue screen (BSOD) | A critical error forces a restart |
| Driver installs | Some drivers ask for a restart |
Summary
| Term | Plain meaning |
|---|---|
| Graceful shutdown | Programs and services finish and save, caches are flushed, then power off |
| Shut down | Ends sessions; with Fast Startup, saves the kernel for a faster next boot |
| Restart | Full shutdown of the kernel, then a fresh boot |
| Fast Startup | Hybrid shutdown: partial hibernate of the kernel into hiberfil.sys |
| Shift + Shut down | Full shutdown without Fast Startup |
shutdown /s /r /a | Command-line tool (describe only; do not run in the lab) |