0

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?

Danny Goodall
  • 798
  • 1
  • 9
  • 33
  • 3
    On windows OS you can set the task to run if the PC is idle for 10 mins – Lucky Chingi Dec 03 '15 at 14:15
  • Just an idea like that, at the end of the test run, add a run configuration to execute a ranorex recording which invoke a shutdown command. This way, you don't have to wait for idle, call this Ranorex run configuration at the end of the batchfile. – Sup3rHugh Dec 07 '15 at 14:58

1 Answers1

1

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.

RoKi0815
  • 58
  • 7