Jump to content

How to change consolwrite


Recommended Posts

Gah! Paste this in your script:

Global $sConsoleOutput = ""

Func MyConsoleWrite($sOutput)
    If @Compiled Then
        $sConsoleOutput = $sOutput & @CRLF
    Else
        ConsoleWrite($sOutput)
    EndIf
EndFunc

Use MyConsoleWrite instead of ConsoleWrite, To read the output then call MsgBox like this:

MsgBox(0, "Console Output", $sConsoleOutput)

 

You can look at the Debug UDF which is shipped with AutoIt by default, (Helpfile -> User Defined Functions Reference -> Debug Managment)

 

TD :)

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

  • Developers

@Danyfirex, No idea what is happening for you. I have the same OS and for me it is working fine.

You do see the Consolewrite output when you run the script in SciTE?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Jos Yes,  When I run from SciTE Consolewrite work Correctly. 

Saludos

Link to comment
Share on other sites

Mother of Bill Gates what is happening with CMD.

Now  Do this 

ShellExecute("cmd.exe",'/k "C:\Users\RAZIEL\Desktop\ASD.exe"')

and Works.

Then do as before opening cmd then dropping my exe file and I got the output too :S

 

Saludos

Edited by Danyfirex
EDIT
Link to comment
Share on other sites

hi all,

For my own, is use that:

DllCall("kernel32.dll", "none", "OutputDebugString", "str", "What you want !!!!") ;   ; => Output to Win32 debug output

From the exe, users won't see anything, but if you run DebugView  you will see all what you want.

http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx    You'll see all the output.
I use this function to replace my consolewrite:

Func Log($Texte)
  $texttmp = @YEAR & @MON & @MDAY & "-" & @HOUR & "H" & @MIN & "m" & @SEC &  " >: " & $Texte

FileWrite($Fichier_DEBUG, $texttmp)   ; => Output to a file
ConsoleWrite2( $texttmp )   ; Output to console.
DllCall("kernel32.dll", "none", "OutputDebugString", "str", $texttmp) ;   ; => Output to Win32 debug output
    ; http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx
EndFunc

hope it helps.

Edited by K0valski
I was so shame not to have say hi ! :)
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...