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?
You can also add the following compiler switch to the top of your script:
#pragma compile(Console, True)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With