Investigate the problem with these steps
How do I fix the issue of Task Host Windows preventing shutdown in Windows 10?
If Windows refuses to shut down, it may be due to Task Host Window, a system service that manages background tasks and ensures that programs are closed properly before they exit. If Task Host Window detects that programs are still running or that work needs to be saved, it prevents the system from shutting down to prevent possible data loss.
If you are unable to shut down your computer due to the Task Host window, but there is no apparent cause, you should investigate the problem using the steps below.
If the Task Host window prevents you from closing, it could be due to pending updates or problems with the Windows Update process.