How to Fix a Shutdown Delay
If you find your computer is taking a long time to shut down, it could be caused by a number of issues. For example, you may have Fast Startup turned on, which can cause a delay between Windows booting and your computer shutting down.
Another issue is that your PC's page file can be cleared at shutdown, which can take a long time to clear. This is often done for security reasons, but it can also affect how long it takes to close open apps and services.
To fix your slow shutdown problem, you can set the Value data for WaitToKillServiceTimeout to a value that is high enough that Windows will shut down all open apps and services without crashing. This will make your system take longer to shutdown than it otherwise would, but it will also prevent you from losing any work or data.
You can do this by launching Registry Editor with administrative rights and navigating to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control. You can then change the value for WaitToKillServiceTimeout, which is displayed in milliseconds.
There are also a few more things you can do to speed up your shut down process. First, check your Windows Update settings to see if there are any recent updates. If your version of Windows is not up to date, you may need to install the latest update before your computer can properly shutdown. If you're still having a slow shutdown, you can use the Power Troubleshooter to help you diagnose and fix the problem.