Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Print to console/command prompt

I want to write text to console/Windows command prompt in AutoIt. I made a test script as shown below:

Func Test()
   ConsoleWrite("Hello")
EndFunc

Test()

I saved the script as test.au3. When I run it, it does not print to console. I checked ConsoleWrite(); it should print to DOS console if it the script is compiled as a console application.

I compiled the script using Aut2Exe. It still does not print to console. How do I write to console in AutoIt?

like image 365
Neon Flash Avatar asked Jan 13 '16 08:01

Neon Flash


2 Answers

You can also add the following compiler switch to the top of your script:

#pragma compile(Console, True) 
like image 176
Christian Storb Avatar answered Oct 04 '22 14:10

Christian Storb


Just compile your test.au3 like this:

%PathToAutoItVersion%\Aut2Exe\Aut2exe.exe /in test.au3 /out test.exe /console

And then you can Run test.exe and it will print out:

hello
like image 29
Samoth Avatar answered Oct 04 '22 16:10

Samoth