Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1285
  • Last Modified:

Faking Keyboard Input to a CMD window

Does anyone know how to send keystrokes to a CMD windows under Win32 (Windows NT).  I need to be able to send keystrokes to a legacy MSDOS application from another Win32 application, and I also need to be able to examine the screen buffer output from the DOS App.

The Dos app does direct writes to the screen.

Thanks.
0
ptan
Asked:
ptan
1 Solution
 
Irene012397Commented:
If you don't mind your actions to be widely visible, place the keys on clipboard and send alt-space, e, p.

To read the screen, send alt-space, e, m, a lot of shift-arrows and alt-space, e, c.

I think there is no other easy way to communicate with normal DOS windows.
0
 
lightningstalkerCommented:
Most times you can do this using redirection like this:

dosapp < keyboardinputfile > output
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now