In Windows 10, if you have unsaved files on your computer, Windows blocks you when you try to restart, shut down, or log off, so that you can finish saving your files. If you do not perform any action within 1 minutes, Windows 10 will automatically cancel the restart, shutdown, or logoff operation.
If you're sure you can save your unsaved files before Windows restarts, shuts down, or logs off, and you don't want Windows to prevent your computer from restarting or shutting down, you can modify the registry to automatically shut down the application when Windows 10 restarts, shuts down, or logs off.
Take effect on the current user on Windows
Open Registry Editor (REGEDIT);
Navigate to the following directory:
\hkey_current_user\control panel\desktop\
Create a new string value under this directory and name it:
Autoendtasks
Double-click the newly created string value named "Autoendtasks" and set its value data to "1".
This change will take effect immediately, without restarting. After it takes effect, Windows 10 automatically shuts down the application when it restarts, shuts down, or logs off.
Take effect for all users on Windows
Open Registry Editor (REGEDIT);
Navigate to the following directory:
\hkey_users\. DEFAULT\Control Panel\desktop\
Create a new string value under this directory and name it:
Autoendtasks
Double-click the newly created string value named "Autoendtasks" to change its value data to "1".
This change will take effect immediately, without restarting. After it takes effect, Windows 10 automatically shuts down the application when it restarts, shuts down, or logs off.
How to get Win10 to shut down applications automatically when restarting, shutting down, or logging off