I want to run mybat.bat
file located in MyFolder which is different from the current directory. I used the following code:
subprocess.Popen(["mybat", MyArg],
cwd=MyFolder,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
stdin=subprocess.PIPE)
However, I get the following error:
"WindowsError: [Error 2] The system cannot find the file specified"
I should mention that if I replace mybat
with another program in the PATH such as notepad
it works absolutely fine.