简体   繁体   中英

Shut down machine after being idle with batch file?

I don't even know if this is possible, but is there anyway to shut down a machine after (n) minutes, using a batch file?

Currently I already have a batch file which works alongside ranorex and a virtual machine, and I need the machine to shut itself down after it has been idle for 10 minutes or so, just to give everything else in the batch file plenty of time to run. Is there any way of doing this?

Just use the command for shutdown and add the option for the time to wait:

shutdown /s /t 600 /f
  • /s is for shutting down the computer
  • /t is for wait before do the operation with time in seconds (10*60=600)
  • /f is for forcefully close all applications

With shutdown /a you can abort the action befor the time runs off. For more options use the help of the shutdown -command.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM