<div>Hello All,</div>
<div> </div>
<div>I've a batch file to be  invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py'</div>

<div> </div>
<div>(Please find the source files and error below). </div>
<div> </div>
<div><strong>I get the following error:</strong></div>
<div><font color="#cc0000" face="courier new,monospace">Traceback (most recent call last):<br>  File "<string>", line 74, in run_nodebug<br>  File "D:\test.py", line 4, in <module><br>    proc = subprocess.Popen(my_bat,stdin=subprocess.PIPE)<br>
  File "C:\Python25\lib\subprocess.py", line 588, in __init__<br>    errread, errwrite) = self._get_handles(stdin, stdout, stderr)<br>  File "C:\Python25\lib\subprocess.py", line 717, in _get_handles<br>
    c2pwrite = self._make_inheritable(c2pwrite)<br>  File "C:\Python25\lib\subprocess.py", line 746, in _make_inheritable<br>    DUPLICATE_SAME_ACCESS)<br>WindowsError: [Error 6] The handle is invalid</font></div>

<div> </div>
<div><strong>Python Script:</strong></div>
<div><u><font color="#6633ff" face="courier new,monospace">test.py</font></u></div>
<div><font color="#6633ff" face="courier new,monospace">import subprocess,os<br>my_bat = os.getcwd()+'\\test.bat'</font></div>
<div><font color="#6633ff" face="courier new,monospace">proc = subprocess.Popen(my_bat,stdin=subprocess.PIPE)<br>input = '\n'<br>proc.communicate(input)</font></div>
<div> </div>
<div><strong>Batch File</strong></div>
<div><u><font color="#3333ff" face="courier new,monospace">test.bat</font></u></div>
<div><font color="#3333ff" face="courier new,monospace">echo "START'<br>pause<br>echo 'END'</font><br></div>
<div>Please help me with this issue. </div>
<div> </div>
<div>Thanks In Advance,</div>
<div>Tarun</div>