Jump to content

Writing to cmd


Recommended Posts

2 minutes ago, Jos said:

Which limitation? I don't understand which limitations you refer to.

Inability to print text (display) in cmd windows which executed the script, without first compiling the script.

 

2 minutes ago, cbruce said:

Piotr12, I'm guessing you launched "AutoIt.exe myscript.au3" from Windows RUN or from Windows Explorer.

No, I executed it from cmd window.

 

2 minutes ago, cbruce said:

Also, if you launch a Command Prompt window first and then run your AutoIt script from that command line... you will see the output because that Command Prompt window will not close until you exit it manually.

It does not work that way for me :(

Are you sure you don't mean compiled script?

 

1 minute ago, Deye said:

perhaps try something like posted here

I think that is different - simulating keypresses. That's not what I want.

Link to comment
Share on other sites

  • Developers
3 minutes ago, Piotr12 said:

Inability to print text (display) in cmd windows which executed the script, without first compiling the script.

That is because AutoIt3.exe is not a console program but rather a windows program... and it can only be one at the same time.

Jos

EDIT: There is NO problem!

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

14 minutes ago, Jos said:

That is because AutoIt3.exe is not a console program but rather a windows program... and it can only be one at the same time.

Hm I see, well it's a pity. Would be nice if there was AutoIt3CLI.exe. On the other hand, when you run AutoIt3.exe /help, or without any options, won't it print help to cmd window from which you run it?

 

14 minutes ago, Jos said:

EDIT: There is NO problem!

OK, that's why I called it "limitation" (and it's a problem for people like me).

Link to comment
Share on other sites

Whoops! Piotr12... My bad... I forgot that ConsoleWrite() is only good with compiled AutoIt scripts.

This will work when run from the command line with AutoIt.exe:

#include <WinAPI.au3>
_WinAPI_AttachConsole()
$hConsole = _WinAPI_GetStdHandle(1)
_WinAPI_WriteConsole($hConsole, "Hello Piotr12" & @CRLF)

 

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...