I wrote a windows .bat script. To run a list of commands and then shut down the computer.
such as:
c:\someapplication.exe
c:\someapplication2.exe
Shutdown -s -t 0
Sometimes, “c:\someapplication.exe” freezes and do not respond. How can I setup timeout for my command “c:\someapplication.exe”, so that after a certain amount of time, I want windows to force close the application and continue the rest of the commands?
You could use a combination of
pingandtaskkillto do this.Just replace
secondsin thepingcommand with the number of seconds you want to wait before attempting to close the process (enough time so if it’s still running it must have crashed). Then the rest of the app can continue until it is forced to shutdown.