sending keystroke to a dos application

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


Mike,

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);
objWshShell.AppActivate(taskid);
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 www.python.org. wsh can be downloaded from
ms.

Tschuess
Wilfried


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