I'm trying to execute a batch file using a Python script. Is this possible? The Python script is in a different folder than the batch file. For example, the Python script is in C:\users\me\desktop\python
while the batch file is in a folder C:\users\me\desktop\batch
. I prefer not to use the full path to the batch file because I want it to work on other people's computer as well (i.e. the C:\users\me
part might be different).
This is the script I tried (executed from the "python" folder on desktop)
from subprocess import call
path = "..\batch"
call([path+"\test.bat"])
Result: file not found