If the issue occurs in Safe Mode, try the methods listed below.
Reset the power plans to default and see if the shut down time is reduced.
Search CMD from the Start menu and choose Command Prompt (admin). Copy paste the following command and hit Enter: powercfg –restoredefaultschemes Once the command is executed, shut down the machine to see if the issue persists.
Modify the ClearPageFileAtShutdown and WaitToKillServiceTimeout values to see if the PCs shutdown faster.
Note:
Serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. To backup and restore registry key, refer to this link.
Press 'Windows + R' keys on the keyboard together to open the Run dialog box and type the following onto the Run box: REGEDIT Navigate to the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\MemoryManagement On the right pane, double click on ClearPageFile and set the Value Data to 0. Now, navigate to the following registry key: HKEY_LOCAL_MACHINE\SYSTEM|CurrentControlSet\Control On the right pane, double click on WaitToKillServiceTimeout and set its Value Data to 5000. Exit REGEDIT and shut down the machine to see if it works.