Batch File Restart for Multiple Bots

Posts 1–2 of 2 · Page 1 of 1
Batch File Restart for Multiple Bots
The way I've seen most people doing this is making a separate .bat for each bot. But there is a better way! With this code you will be able to run multiple bots on a single .bat file placed anywhere on your computer.
Code:
 @EcHo off
:loop
taskkill /f /im "YourBot.exe" >nul
timeout /t 10 >null
cd /d "C:\Users\Username\Desktop\Bot1\Release"
start "" "C:\Users\Username\Desktop\Bot1\Release\YourBot.exe"
timeout /t 2 >null
cd /d "C:\Users\Username\Desktop\Bot2\Release"
start "" "C:\Users\Username\Desktop\Bot2\Release\YourBot.exe"
timeout /t 2 >null
timeout /t 1700 >null
goto loop
YourBot.exe is the .exe you want to run (duh). "C:\Users\Username\Desktop\Bot1\Release" is just the file which the .exe you click to run your program, and "C:\Users\Username\Desktop\Bot1\Release\YourBot.ex e" is the same as the previous file path except with the .exe you want to run on the end of it. You can just paste as many
Code:
cd /d "C:\Users\Username\Desktop\Bot1\Release"
start "" "C:\Users\Username\Desktop\Bot1\Release\YourBot.exe"
timeout /t 2 >null
as you want before "timeout /t 1700 >null". Here's an example with 6 instances of NecroBot.
 
Spoiler
[CODE @EcHo off
:loop
taskkill /f /im "NecroBot.exe" >nul
timeout /t 10 >null
cd /d "C:\Users\Hunter\Desktop\Necro_41628\Release"
start "" "C:\Users\Hunter\Desktop\Necro_41628\Release\Necro Bot.exe"
timeout /t 2 >null
cd /d "C:\Users\Hunter\Desktop\Necro_213122\Release"
start "" "C:\Users\Hunter\Desktop\Necro_213122\Release\Necr oBot.exe"
timeout /t 2 >null
cd /d "C:\Users\Hunter\Desktop\Necro_313444\Release"
start "" "C:\Users\Hunter\Desktop\Necro_313444\Release\Necr oBot.exe"
timeout /t 2 >null
cd /d "C:\Users\Hunter\Desktop\Necro_313299\Release"
start "" "C:\Users\Hunter\Desktop\Necro_313299\Release\Necr oBot.exe"
timeout /t 2 >null
cd /d "C:\Users\Hunter\Documents\Release"
start "" "C:\Users\Hunter\Documents\Release\NecroBot.ex e"
timeout /t 2 >null
cd /d "C:\Users\Hunter\Desktop\Necro_ejh3141\Release "
start "" "C:\Users\Hunter\Desktop\Necro_ejh3141\Release\Nec roBot.exe"
timeout /t 1700 >null
goto loop[/CODE]
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

Need help?