title: Using Python pywin32 to send keystrokes to interactive win32 console application
body: <p>So I have been trying to use Python <code>pywin32</code> package to send inputs to an interactive console based win32 exe which gives me a bunch of options when executed and based on the input keyed in by the user subsequent menus are displayed. After some reading around on the net I did try to execute the following code but it is still unable to send the input to the program, so if anyone has been able to achieve something similar, please let me know.</p>
  
  <p>the code I have been trying is as follows:</p>
  
  <pre><code>import win32com.client
  def main():
      shell = win32com.client.Dispatch("WScript.Shell")
      shell.run('cmd /K cd "E:\\Documents and Settings\\Owner\\Desktop\\pds\\"   &amp;&amp; CONVERT.EXE')
      shell.AppActivate('E:\\Documents and Settings\\Owner\\Desktop\\pds\\CONVERT.EXE')
      print("sending keys...")
      shell.SendKeys("trial.bin")
      shell.SendKeys("{ENTER}")
  
  if __name__ == '__main__':
      main()
  </code></pre>