Solved How to fix slow shutdowns?


cheaterslick

Well-known member
Power User
Local time
2:09 AM
Posts
1,450
Location
Virginia, USA
OS
Windows 11 Pro 25H2 build: (26200.7623)
Hello,

I've been running into slow shutdowns on my Lenovo laptop. It's taking over a minute (to minute and a half) to shut down and I was wondering how to speed up the process.

Years ago I to remember there was a batch file that would force quit any hanging apps (I think at the time it was a mousepad) for Windows 10 so I am wondering if there's some kind of an equivalent for Windows 11?

Any help would be most appreciated, thank you.
 
Windows Build/Version
Windows 11 23H2 Pro

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 build: (26200.7623)32GB
    OS
    Windows 11 Pro 25H2 build: (26200.7623)
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro
    Memory
    32GB
  • At a glance

    Microsoft 25H2 ProIntel Core Ultra 764GBIntel Integrated Graphics
    Operating System
    Microsoft 25H2 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Pro 14 - PC14250
    CPU
    Intel Core Ultra 7
    Memory
    64GB
    Graphics card(s)
    Intel Integrated Graphics
    Hard Drives
    Micron 1TB SSD
Here's the batch script you're looking for.

Batch:
@Echo Off & Cls


Call :NoAdmin


:_Ask
Cls & Mode CON  LINES=11 COLS=90 & Color 0E & Title Coded By FreeBooter
Echo.
Echo.
Echo.
Echo       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo       º Do You Want To Close Programs That Is Not Responding During Shutdown (Y/N)? º 
Echo       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Echo.
Echo.


Set /p input=^>
If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Add)

:_Ex
If /i Not %input%==N  (Goto :_Ask) Else (Goto :EOF)



:_Add

Reg add "HKCU\Control Panel\Desktop"  /v HungAppTimeout   /t REG_SZ  /d 1000  /f 2>&1 >nul

Reg add "HKCU\Control Panel\Desktop"  /v WaitToKillAppTimeout  /t REG_SZ  /d 2000  /f 2>&1 >nul

Reg add "HKCU\Control Panel\Desktop"  /v AutoEndTasks  /t REG_SZ /d 1  /f 2>&1 >nul

Reg add "HKU\S-1-5-19\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d "1" /f 2>&1 >nul

Reg add "HKU\S-1-5-19\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "1000" /f 2>&1 >nul

Reg add "HKU\S-1-5-19\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "2000" /f 2>&1 >nul

Reg add "HKU\S-1-5-20\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d "1" /f 2>&1 >nul

Reg add "HKU\S-1-5-20\Control Panel\Desktop" /v "HungAppTimeout" /t REG_SZ /d "1000" /f 2>&1 >nul

Reg add "HKU\S-1-5-20\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "2000" /f 2>&1 >nul

Reg add "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v "AutoEndTasks" /t REG_SZ /d 1 /f 2>&1 >nul

Reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control"  /v "WaitToKillServiceTimeout" /t REG_SZ /d "2000" /f 2>&1 >nul

Cls & Mode CON  LINES=11 COLS=80 & Color 0E &Title Coded By FreeBooter
Echo.
Echo.
Echo.
Echo       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
Echo       º Automatically Terminating User Processes During Shutdown Enabled º 
Echo       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
Echo.
Echo.
ping -n 6 localhost >nul
Exit


:NoAdmin
Reg query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls & Mode CON  LINES=5 COLS=48 & Color 0C &  Title  .....................- WARNING -.......................
 Echo.
 Echo.
 Echo  YOU MUST HAVE ADMINISTRATOR RIGHTS TO CONTINUE
 Pause >Nul & Exit
)
 Cls
 Goto :eof
 

Attachments

My Computer My Computer

At a glance

Windows 11AMD Ryzen 7 5700GMicron Technology DDR4-3200 16GBNVIDIA GeForce RTX 3060
OS
Windows 11
Computer type
PC/Desktop
Manufacturer/Model
HP Pavilion
CPU
AMD Ryzen 7 5700G
Motherboard
Erica6
Memory
Micron Technology DDR4-3200 16GB
Graphics Card(s)
NVIDIA GeForce RTX 3060
Sound Card
Realtek ALC671
Monitor(s) Displays
Samsung SyncMaster U28E590
Screen Resolution
3840 x 2160
Hard Drives
SAMSUNG MZVLQ1T0HALB-000H1
I would suspect you have some app causing the issue. You can find out which one by doing a clean boot.
If it doesn't happen in a clean boot, you have some software conflicting with Windows. Brink's procedure will help you weed out which one. Perform a Clean Boot in Windows 11 to Troubleshoot Software Conflicts Tutorial

I would also make sure there are no corrupt system files that is causing this problem. Open a command prompt as administrator and type sfc /scannow
Pay attention to the scan results to see if SFC found anything it could not repair. If it found corruption it could not fix followup with this command (note the spaces)
dism /online /cleanup-image /restorehealth
Restart computer

(Note-you can follow up with another sfc /scannow command to make sure that dism repaired the files)
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
Pay attention to the scan results to see if SFC found anything it could not repair. If it found corruption it could not fix followup with this command (note the spaces)

I did that and it did find something to repair. It repaired it, but it's still slow shutdown.

dism /online /cleanup-image /restorehealth
Restart computer

Same thing. No change.

(Note-you can follow up with another sfc /scannow command to make sure that dism repaired the files)

I did that, too. It didn't find anything to repair the second time, yet the hanging shutdown still exists, which leads me to believe the repair it did eariler is unrelated to the problem at hand.

I think I'll try that batch file, next....

I appreciate your input here, thanks!
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 build: (26200.7623)32GB
    OS
    Windows 11 Pro 25H2 build: (26200.7623)
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro
    Memory
    32GB
  • At a glance

    Microsoft 25H2 ProIntel Core Ultra 764GBIntel Integrated Graphics
    Operating System
    Microsoft 25H2 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Pro 14 - PC14250
    CPU
    Intel Core Ultra 7
    Memory
    64GB
    Graphics card(s)
    Intel Integrated Graphics
    Hard Drives
    Micron 1TB SSD
did you try the clean boot?
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
did you try the clean boot?

Not yet, but that is something that's going to take some time, going through all those start-up entries, one-by-one.

Even with all the MS services hidden, I have about three times the entries than the example shown on those clean boot instructions you linked to.

Bootup times are actually much faster than the shutdowns, so I really don't have any complaint, there.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 build: (26200.7623)32GB
    OS
    Windows 11 Pro 25H2 build: (26200.7623)
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro
    Memory
    32GB
  • At a glance

    Microsoft 25H2 ProIntel Core Ultra 764GBIntel Integrated Graphics
    Operating System
    Microsoft 25H2 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Pro 14 - PC14250
    CPU
    Intel Core Ultra 7
    Memory
    64GB
    Graphics card(s)
    Intel Integrated Graphics
    Hard Drives
    Micron 1TB SSD
I have verbose mode enabled so if it's slow at one phase of startup/shutdown you can tell where to start looking.
You can set it in Group Policy:
Computer Configuration > Administrative Templates > System. In the right pane, double-click on "Display highly detailed status messages".
 

My Computer My Computer

At a glance

Windows 11 Pro 24H2i7 Ultra16GBIntel
OS
Windows 11 Pro 24H2
Computer type
Laptop
Manufacturer/Model
LG
CPU
i7 Ultra
Memory
16GB
Graphics Card(s)
Intel
Sound Card
Intel Realtek
Monitor(s) Displays
Laptop 17" & TB4 Dell 27" QHD Ultrasharp w/integral TB4 hub
Screen Resolution
2560x1600
Hard Drives
1TB SSD, 5 external WDs
Mouse
Logitech Master MX 3S
Browser
Vivaldi
Antivirus
Kaspersky Premium Suite
I have verbose mode enabled so if it's slow at one phase of startup/shutdown you can tell where to start looking.
You can set it in Group Policy:
Computer Configuration > Administrative Templates > System. In the right pane, double-click on "Display highly detailed status messages".

And what would it look like? What would you see?
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 build: (26200.7623)32GB
    OS
    Windows 11 Pro 25H2 build: (26200.7623)
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro
    Memory
    32GB
  • At a glance

    Microsoft 25H2 ProIntel Core Ultra 764GBIntel Integrated Graphics
    Operating System
    Microsoft 25H2 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Pro 14 - PC14250
    CPU
    Intel Core Ultra 7
    Memory
    64GB
    Graphics card(s)
    Intel Integrated Graphics
    Hard Drives
    Micron 1TB SSD
that's going to take some time, going through all those start-up entries, one-by-one.
To prove whether a certain app is causing the problem takes less than 5 minutes. You disable all the entries except for MS ones, and restart. If restart is still slow, that tells you an application is not your problem. Now, the time is involved it your restart is normal and you then have to start eliminating apps to get down to the troublesome one..
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
And what would it look like? What would you see?

You would see one phase of the shutdown process taking an inordinate amount of time.
You can tell if it's a service, app or process holding things up.

You disable all the entries except for MS ones, and restart. If restart is still slow, that tells you an application is not your problem

This is a shutdown not startup issue though. :cool:
 

My Computer My Computer

At a glance

Windows 11 Pro 24H2i7 Ultra16GBIntel
OS
Windows 11 Pro 24H2
Computer type
Laptop
Manufacturer/Model
LG
CPU
i7 Ultra
Memory
16GB
Graphics Card(s)
Intel
Sound Card
Intel Realtek
Monitor(s) Displays
Laptop 17" & TB4 Dell 27" QHD Ultrasharp w/integral TB4 hub
Screen Resolution
2560x1600
Hard Drives
1TB SSD, 5 external WDs
Mouse
Logitech Master MX 3S
Browser
Vivaldi
Antivirus
Kaspersky Premium Suite
Try disabling Windows fast startup.
Check the process and service termination timeouts in the registry (in milliseconds).
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
WaitToKillServiceTimeout = 5000

Windows can log the reason for the delay in shutting down the computer

Shutdown Performance Monitoring
200 Windows has shutdown
201 This application caused a delay in the system shutdown process
202 This device caused a delay in the system shutdown process
203 This service caused a delay in the system shutdown process

For example, it could be

1.webp

If it's a one-time thing, you don't have to worry.
 

My Computer My Computer

At a glance

Microsoft Windows 11 HomeIntel Core i5-13490F2 x 16 Patriot Memory (PDP Systems) PSD516G56...GIGABYTE GeForce RTX 4070 WINDFORCE OC 12G (G...
OS
Microsoft Windows 11 Home
Computer type
PC/Desktop
Manufacturer/Model
MSI MS-7D98
CPU
Intel Core i5-13490F
Motherboard
MSI B760 GAMING PLUS WIFI
Memory
2 x 16 Patriot Memory (PDP Systems) PSD516G560081 6400MT (32-37-37-74); 1.35V)
Graphics Card(s)
GIGABYTE GeForce RTX 4070 WINDFORCE OC 12G (GV-N4070WF3OC-12GD)
Sound Card
Bluetooth Аудио
Monitor(s) Displays
INNOCN 15K1F
Screen Resolution
1920 x 1080
Hard Drives
WD_BLACK SN770 250GB
KINGSTON SNV2S1000G (ELFK0S.6)
PSU
Thermaltake Toughpower GF3 1000W
Case
CG560 - DeepCool
Cooling
ID-COOLING SE-224-XTS / 2 x 140Mm Fan - rear and top; 3 x 120Mm - front
Keyboard
Corsair K70 RGB TKL
Mouse
Corsair KATAR PRO XT
Internet Speed
100 Mbps
Browser
Firefox
Antivirus
Microsoft Defender Antivirus
Other Info
https://www.userbenchmark.com/UserRun/66553205
This is a shutdown not startup issue though
Doesn't matter. A clean boot would eliminate any 3rd party app being the cause of your SHUTDOWN issue. All you have to do is put it in a clean boot state and restart.. Then SHUT DOWN to see if it's any faster. If it is, one of your apps is the problem.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 26200.8655i9-10900 10 core 20 threads32 gbnone-Intel UHD Graphics 630
    OS
    Windows 11 Pro 25H2 26200.8655
    Computer type
    PC/Desktop
    Manufacturer/Model
    Dell Optiplex 7080
    CPU
    i9-10900 10 core 20 threads
    Motherboard
    DELL 0J37VM
    Memory
    32 gb
    Graphics Card(s)
    none-Intel UHD Graphics 630
    Sound Card
    Integrated Realtek
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    2x1tb Solidigm m.2 nvme /External drives 512gb Samsung m.2 sata+2tb Kingston m2.nvme
    PSU
    500w
    Case
    MT
    Cooling
    Dell Premium
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    so slow I'm too embarrassed to tell
    Browser
    #1 Edge #2 Firefox
    Antivirus
    Defender+MWB Premium
  • At a glance

    Windows 11 Pro 24H2 26200.8457AMD Ryzen 7 6800U32 gbintegrated
    Operating System
    Windows 11 Pro 24H2 26200.8457
    Computer type
    PC/Desktop
    Manufacturer/Model
    Beelink Mini PC SER5
    CPU
    AMD Ryzen 7 6800U
    Memory
    32 gb
    Graphics card(s)
    integrated
    Sound Card
    integrated
    Monitor(s) Displays
    Benq 27
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Crucial nvme
    Keyboard
    Logitech wired
    Mouse
    Logitech wireless
    Internet Speed
    still too embarrassed to tell
    Browser
    Firefox
    Antivirus
    Defender
    Other Info
    System 3 is non compliant Dell 9020 i7-4770/24gb ram Win11 PRO 26200.8457
Doesn't matter. A clean boot would eliminate any 3rd party app being the cause of your SHUTDOWN issue. All you have to do is put it in a clean boot state and restart.. Then SHUT DOWN to see if it's any faster. If it is, one of your apps is the problem.

True. I could luck out and find the offending service on the first couple of re-starts. Or I can go through the next 55 non-MS services one-by-one to see if which one's the case.

~

However, I did try the script in post #2 and that worked great. Just like it did in Windows 10. :-) 👍

A brute-force approach that's pretty effective.
 

My Computers My Computers

  • At a glance

    Windows 11 Pro 25H2 build: (26200.7623)32GB
    OS
    Windows 11 Pro 25H2 build: (26200.7623)
    Computer type
    Laptop
    Manufacturer/Model
    Microsoft Surface Pro
    Memory
    32GB
  • At a glance

    Microsoft 25H2 ProIntel Core Ultra 764GBIntel Integrated Graphics
    Operating System
    Microsoft 25H2 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Dell Pro 14 - PC14250
    CPU
    Intel Core Ultra 7
    Memory
    64GB
    Graphics card(s)
    Intel Integrated Graphics
    Hard Drives
    Micron 1TB SSD
Back
Top Bottom