If some applications are open when you are shutting down Windows 10/8/7, such applications will be not be automatically terminated during the shutdown. But you will be asked if you want to save your work. But if you find that this is not happening, you may have to do the following:
Turn off automatic termination of applications that block or cancel shutdown
Type gpedit.msc in start search and hit enter to open the Group Policy Editor. The Group Policy Editor is available in Windows 10 Pro, Windows 10 Enterprise, and Windows 10 Education editions only, and not in Windows 10 Home.
Navigate to Computer Configuration > Administrative Templates > System > Shutdown Options.
Now in the right pane, click on Turn off automatic termination of applications that block or cancel shutdown.
Click on Edit policy setting. From the window that opens you can enable or disable this policy.
This policy setting specifies whether Windows will allow console applications and GUI applications without visible top-level windows to block or cancel shutdown. By default, such applications are automatically terminated if they attempt to cancel shutdown or block it indefinitely.
If you enable this setting, console applications or GUI applications without visible top-level windows that block or cancel shutdown will not be automatically terminated during the shutdown.
If you disable this setting, these applications will be automatically terminated during the shutdown, helping to ensure that Windows can shut down faster and more smoothly.
You can also use the Windows Registry to achieve this. Run regedit and navigate to the following key:
Right-click in the right pane, and select New > DWORD (32-bit Value), name it AllowBlockingAppsAtShutdown and give it a value of 1.
Hope this helps.