Simple auto-restarter in batch
Hello!
Today I was a bit bored and I saw a peoples had some problems with an autorestarter(.exe) and I tried to do an auto-restarter which can be used easily. I did in 5 minutes and tested it with "notepad.exe". This should work, I'm 98% sure. Here is the code:
Code:
:: Simple auto-restarter ::
:: by [email protected] ::
:: CONFIGURATION
:: time(in seconds)
set time=10
:: program name
set program=notepad.exe
:: run command(the batch command)
set batchCommand=notepad.exe c:/test.txt
:: this file name(the name)
set this=autorestarter.bat
:: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
:: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
:: DO NOT EDIT BELOW ONLY IF YOU KNOW WHAT ARE YOU DOING!
:: init
@echo off
cls
title Simple auto-restarter by D4NyZ
echo Opening the application
start %batchCommand%
echo Application opened
ping 127.0.0.1 -n %time% > nul
echo Closing the application
taskkill /im %program%
echo ...
:: executes this batch file again
%this%
Save it as autorestarter.bat and put in your server folder.