I'm using this code:
test.py:
cmd_line = str('C:\mybat.bat') + " "+str('C:\')+" "+str('S:\Test\myexe.exe')+" "+str('var4')+" "+str('var5')+" "+str('var6')+" "+str('var7')+ " "+str('var8') + " "+str('var9')+ " "+ str('var10')
process = subprocess.Popen(cmd_line, stdin=PIPE, stderr=None, stdout=None, shell=True)
process.communicate()
retcode = process.returncode
mybat.bat:
cd /d %1
%2 %3 %4 %5 %6 %7 %8 %9 %10
It's working fine until the parameter: "var10", because I dont know why the bat is taking the same value for %1, and not for %10, as this:
... >cd /d C:\
C:\> S:\Test\myexe.exe var4 var5 var6 var7 var8 var9 C:\0
I want to read for the last parameter var10, not C:\0, because the bat it's taking the value for var1 and adding just the 0, but it should be var10.
Thank you!