IanN1990

Output script to DOS

5 posts in this topic

#1 ·  Posted

Hi,

I am having some issues displaying the STDOUT Stream within command prompt

Eample.exe - Code

#AutoIt3Wrapper_Change2CUI=Y
   sleep(1000)
   ConsoleWrite("Test")
   sleep(1000)

Cmd 

Start /Wait C:\Example.exe

The command prompt successfully runs and waits for the program to close but doesn't display the console written information?

Help file says 

"The purpose for this function is to write to the STDOUT stream. Many popular text editors can read this stream. Scripts compiled as Console applications also have a STDOUT stream.
This does not write to a DOS console unless the script is compiled as a console application." and https://www.autoitscript.com/wiki/AutoIt3Wrapper_Directives shows

#AutoIt3Wrapper_Change2CUI (Y/N) Change output program to CUI in stead of GUI. N

So where have i gone wrong :)

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

When running a slightly modified version of your script (compiled and double clicked in Windows Explorer) it displays the expected values:

#AutoIt3Wrapper_Change2CUI=Y
Sleep(1000)
Global $iDataWritten = ConsoleWrite("Test")
Sleep(1000)
MsgBox(0, "Result", "Bytes written " & $iDataWritten)

Test.png

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Just to confirm. When you double click the test.exe it opens up a dos display?

As if that is the case. Mine does not :S

Edited by IanN1990

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I completely uninstalled and reinstalled Autoit 3.5.4 but had the same issue.

I found though with SciTE4AutoIt3.exe installed it works as you describe it. 

Edited by IanN1990

Share this post


Link to post
Share on other sites

#5 ·  Posted

There is no AutoIt version 3.5.4.  Are you talking about the SciTE version?

What's the version of AutoIt you run?

MsgBox(0, "", @AutoItVersion)

Do you run the full SciTE version or the light version that comes with AutoIt?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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