Jump to content
Sign in to follow this  
RAMzor

How to read information from DOS aplication

Recommended Posts

RAMzor

Hello!

How can I read/write information from/to DOS aplication opened in DOS window.

I will create windows shell for old DOS program (eng. calculation)

Example of window attached

post-1057-1200171523_thumb.png

Share this post


Link to post
Share on other sites
ResNullius

Hello!

How can I read/write information from/to DOS aplication opened in DOS window.

I will create windows shell for old DOS program (eng. calculation)

Example of window attached

Have you checked out StdOutRead() and StdinWrite() ?

Share this post


Link to post
Share on other sites
RAMzor

Yes!

But the StdOutRead() function pause the script :D

Probably no characters to be read from the stream.

Edited by RAMzor

Share this post


Link to post
Share on other sites
The Kandie Man

Yes!

But the StdOutRead() function pause the script :D

Probably no characters to be read from the stream.

From the help file under the StdOutRead function's remarks:

If at any time when this function is called (except for "peeking" as described below) there are no characters to be read from the stream, the StdoutRead function will block (pause) and not return until there are characters to be read from the stream.

Set the third parameter to true so that it only peeks at the stream and returns immediately.

- The Kandie Man ;-)


"So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire

Share this post


Link to post
Share on other sites
RAMzor

... Set the third parameter to true ...

- The Kandie Man ;-)

It's not work, probably this function will not work in general with this DOS aplication.

Any another idea?

How can I select and copy to clipboard all data in DOS window?

Share this post


Link to post
Share on other sites
Xenobiologist

Hi,

not a very good soultion, but ...

Opt('WinTitleMatchMode', 2)
Global $title = 'C:\WINNT\system32\cmd.exe'
Run('cmd.exe', '', @SW_HIDE)
Sleep(500)
ControlClick($title, '', '', 'right', 1, 1, 1)
Sleep(400)
ControlSend($title, '', '', 'a')
Sleep(400)
ControlSend($title, '', '', '{enter}')
$var = ClipGet()
MsgBox(0,"", $var)

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×