@echo off :: Launch botty detached with console output captured to log\console_.log :: (used for unattended/remote starts where no interactive console exists) cd /d "C:\Users\alex\Downloads\my-botty" :: Single-instance guard: F11/F12 are GLOBAL hotkeys, so two bot instances :: receive every press and fight each other (one starts, the other pauses). powershell -NoProfile -Command "Get-CimInstance Win32_Process -Filter \"Name='python.exe'\" | Where-Object {$_.CommandLine -like '*my-botty*main.py*'} | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }" set "TS=%RANDOM%" call "C:\Users\alex\Downloads\my-botty\run_botty.bat" > "C:\Users\alex\Downloads\my-botty\log\console_%TS%.log" 2>&1