To make your Windows computer automatically shut down when not in use or when it is idle, use the Task Scheduler, use the Create Task wizard to create a Shutdown event as explained in this post. However, in the Conditions tab, set the condition in terms of time, when the computer should shut down. When you do that, the computer will automatically shut down after that much idle time has elapsed.