Jump to content

Output script to DOS


Recommended Posts

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 :)

 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...