sending keystroke to a dos application

Wilfried Wiehler Wilfried.Wiehler at
Tue Feb 1 03:19:35 EST 2000


another solution: the Windows Scripting Host has the so called SendKeys
control. Sorry, I have only a JavaScript example:

objWshShell = WScript.CreateObject("WScript.Shell");
taskid = objWshShell.Run("D:\\test\\winmips.EXE",1,0);
WScript.sleep(1000); // wait for winmips to get the focus
objWshShell.SendKeys("%(FL)");// Alt/File/Load

As I remember wsh scripts can be written in Python too. The details
should be found somewhere on wsh can be downloaded from


Mike Mueller wrote:
> Does the dos window offer COM support I could use to pass some keystrokes?

More information about the Python-list mailing list