Link to home
Start Free TrialLog in
Avatar of mittel
mittel

asked on

write to command line

I am writing an application that runs from a command prompt. I would like to write to the command line instead of using msgbox.
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

This can and cannot be done depending on how you want to look at it.

Yes...it is possible to create a VB App that uses a console window for input/output.  HOWEVER, the VB app creates its own console window to achieve this.  Here are two links on the topic:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q171/6/54.asp&NoWebContent=1

http://internettrash.com/users/fdb/cons.htm

I could not find one example of a VB App sending output to the console window that it was executed from.

One sloppy possiblity that will definitely not be foolproof:

Use the FindWindow API to get a handle to the command window.  Put the message you want in the clipboard.  Activate the command window.  Use send keys to Edit --> Paste your message into the command window.

Any Experts want to implement that? =)

Idle_Mind
Avatar of fantasy1001
fantasy1001

Questioner:
Can I ask what is the intention you implement this method?

~ fantasy ~
What did you decide to do Mittel?
Avatar of mittel

ASKER

To fantasy: I wanted to write an application like that using C where you can write back to the command window.

To idle mind: Although your solutions sounded very promising, I ended up just writing to a log file.

mittel
I recommend the question be closed points refunded.
mittel, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

Dan Rollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial