This is a very simple trick and quite easy to implement. The steps are as follows:-
Open Command Prompt by either searching for “cmd” in windows start menu or Enter or Press Win+R and Type cmd and hit Enter.
Type shutdown.exe –s –f –t 1800 in the Command Prompt.
1800 is the amount of time you want to shut down your PC in seconds .i.e 30 min
All done, now hit Enter and exit the Command Prompt. This means that your computer will auto shutdown after 30 mins.
That’s all guys! You’ve done! Now, let me explain how the command above is working.Infact, the command shutdown.exe –s –f –t 1800 will shutdown your computer after 1800 seconds (30 Minutes). You can input your desired time by replacing 1800.
Here, shutdown.exe is an executable file Here shutdown.exe is a executable program file that executes options –s –f –t,where –s causes to schedule your computer to shutdown automatically at a certain time given by –t option. Here –f used to force close the running applications without any warning.
Additionally, you can replace –s with –r to restart your computer after a certain time automatically. Executable program file shutdown.exe will execute –r instead of –s and provide a schedule to restart your computer automatically after the you set.