Sign in to follow this  
Followers 0
omi

How to display text on command prompt.

2 posts in this topic

Hi All,

I am making one console exe for that i need to display some text to user on his console.

How can i display text on command prompt?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Be a little more descriptive, Omi... :P

You could run a command through command prompt and have it output to a file, rather than the console. Then you can read that file and continue.

The below example runs the "dir" command and displays it in a MsgBox().

Run(@ComSpec & " /c " & 'Dir > ' @ScriptDir & "\output.txt", "", @SW_HIDE)
$Output = FileRead(@ScriptDir & "\output.txt")
MsgBox(0,"CMD Output",$Output)

 

Try searching the forums, for alternative methods, as they do exists already.

If that isn't what you were talking about, and you want to display text 'INSIDE' the windows console window, use a .bat file, as that will be easier...
 

@Echo off
Color 02
Echo 'Text inside console'

If you're trying to simply show the user text through your CLI AutoIt script, then you can just use

ConsoleWrite("Hello World!" & @CRLF)

The @CRLF causes the new ConsoleWrite to write to a new line. Carriage Return + Line Feed. Edited by BinaryBrother

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  
Followers 0