I have the solution without installing anything. Read this article:
https
/www.askvg.com/windows-tip-disable-this-app-is-preventing-shutdown-or-restart-screen/
It is magic. A simple tweak.
1. Type regedit in RUN or Start search box and press Enter. It'll open Registry Editor.
2. Now go to following key:
HKEY_CURRENT_USER\Control Panel\Desktop
3. In right-side pane, right-click on empty area and create a new String AutoEndTasks and set its value to 1
Image
4. That's it. Close Registry Editor and restart your computer to take effect.
Now Windows will automatically end task of all running apps without showing you "This app is preventing..." message on screen whenever you want to sign out, restart or shut down your computer.
If you are worried about editing Registry and want a ready-made Registry script to do the whole task automatically, you can download the Registry script from the "Collection of Registry tweaks" topic mentioned in the beginning of this article.