How to Control a Console (old DOS) App... 
Author Message
 How to Control a Console (old DOS) App...

Does anyone know if it is possible to:
A) Control and old DOS app from a VC (or VB) app (i.e. send it keystrokes,
etc.), and also
B) Read output to the clipboard with mark and copy

I have to interface with and old MS-DOS application, and what I want to do
is send it a series of keystrokes, and then read the text on row 6, columns
8-26 (or somewhere else).  Is this possible?  I know it can be done
manually.  Type some stuff, click in the upper left corner, choose
Edit->Mark, highlight the words you want, hit enter, and PRESTO, your stuff
is on the clipboard.  Surely there is a way to do this programmatically.

I know I need to do a FindWindow to get the window handle, but beyond that,
I am clueless.  I was able to find some old articles (16 bit VB; would only
work on 9x, not NT) that detailed using sendkeys and pasting the commands
into the clipboard, setting the Dos window active, and sending the clipboard
buffer; but this seems a little (read a LOT) klugdey.  I do want to run this
on Workstation.
Please CC to email if possible.

Hoping I'm not hoping for too much,
Scott Leonard
sbl"AT"msn.com

Afterthought: WSH, VBScript,JScript maybe?



Sun, 31 Mar 2002 03:00:00 GMT  
 How to Control a Console (old DOS) App...
Have you tried the WSHSendKeys method (or Sendkeys in WSH 2.0) provided by
WSH Extend? Also there is a possibility to redirect input/output from MS-DOS
into files. Just have a look into the WSH Bazaar. There are samples (using
WSHSendKeys to copy and past data between Calc and the Windows Editor - it
might be the same for the DOS-Window).

G. Born

Check out the WSH Bazaar at:

http://ourworld.compuserve.com/homepages/Guenter_Born/index0.htm

Microsoft schrieb in Nachricht ...

Quote:
>Does anyone know if it is possible to:
>A) Control and old DOS app from a VC (or VB) app (i.e. send it keystrokes,
>etc.), and also
>B) Read output to the clipboard with mark and copy

>I have to interface with and old MS-DOS application, and what I want to do
>is send it a series of keystrokes, and then read the text on row 6, columns
>8-26 (or somewhere else).  Is this possible?  I know it can be done
>manually.  Type some stuff, click in the upper left corner, choose
>Edit->Mark, highlight the words you want, hit enter, and PRESTO, your stuff
>is on the clipboard.  Surely there is a way to do this programmatically.

>I know I need to do a FindWindow to get the window handle, but beyond that,
>I am clueless.  I was able to find some old articles (16 bit VB; would only
>work on 9x, not NT) that detailed using sendkeys and pasting the commands
>into the clipboard, setting the Dos window active, and sending the
clipboard
>buffer; but this seems a little (read a LOT) klugdey.  I do want to run
this
>on Workstation.
>Please CC to email if possible.

>Hoping I'm not hoping for too much,
>Scott Leonard
>sbl"AT"msn.com

>Afterthought: WSH, VBScript,JScript maybe?



Mon, 01 Apr 2002 03:00:00 GMT  
 How to Control a Console (old DOS) App...


Fri, 19 Jun 1992 00:00:00 GMT  
 How to Control a Console (old DOS) App...

I cannot start this app myself, it is launched by another program.  If I
could, I have found that the win32 API has an AllocConsole function, from
which I can get the GetStdHandle(STD_OUTPUT_HANDLE), and read/write to the
console.  However, when I shell("C:\command.com") in VB6, I can no longer
read/write to the console until I type "exit", then all my writes show up en
masse.  However, I don't think this is really the route I can pursue, since
I do not launch the DOS app; I can only use FindWindow, and go from there.

Sorry about "Microsoft",
Thanks,
Scott Leonard
sbl"AT"msn.com



Mon, 01 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to Control a Console (old DOS) App...

2. How to Control a Console (old DOS) App...

3. HELP: how to control a v.old dos app using WSH/VBS

4. Help with WSH + ADO client side Foxpro old dos app

5. running console app in same console

6. VBScript front-end to a console app.

7. Execute console app to same window

8. Using WshShell.Run to launch console app

9. how to insert a console command (dos ) in a jscript

10. Grabbing DOS console output

11. Printing to the ms-dos console

12. How can I call a console app from WSH in same console?

 

 
Powered by phpBB® Forum Software