Print to console/command prompt

Neon Flash picture Neon Flash · Jan 13, 2016 · Viewed 8.5k times · Source

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?

Answer

chstorb picture chstorb · Apr 5, 2017

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

#pragma compile(Console, True)