Need to make an auto exec batch file [closed]

You could specify an atexit handler in your python script:

import atexit
import os

def exit_handler():


Where test.bat contains:

Python C:/Path/To/

However, this will also cause the script to start up again if it exits legitimately.

Perhaps if you could identify what exit code is sent when it exits “randomly”, you can check for that exitcode in atexit and start the batch file up if it matches your problematic exit code.

Browse More Popular Posts

Leave a Comment