I have a script that runs a program.exe in the background. How to close a program from the background in task manager after closing the command window script script command = [ "program.exe", "-i", "-o", ] process = subprocess.Popen( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1, universal_newlines=True, ) stdout, stderr = process.communicate() print(command) Continue reading...