ndinev

Strange behavior when running script from command line

5 posts in this topic

#1 ·  Posted (edited)

Hi all,

I found two problems when I am trying to run scripts from command line

Here is the script 123.au3:

For $i=1 To 10
   Sleep(1000)
   ConsoleWrite($i & @CRLF)
Next

here is how I start it

AutoIt3.exe /AutoIt3ExecuteScript 123.au3

Problem1: I am not getting any console print as a expected - 1,2,3... etc

Problem2: Seems the script is executed as separated process and console is free immediately

When script is compiled with /console to an exe it works fine. But I want my scripts not to be compiled.

How can I solve those problems?

Is it possible to run script in console way?

Thanks

Edited by ndinev

Share this post


Link to post
Share on other sites



This is because AutoIt3.exe is not compiled a console application.

Try using another compiled script as the launcher of your script.

Ensure it is compiled as console and contains this directive:

#pragma compile(AutoItExecuteAllowed, true)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

AutoIt3.exe "path123.au3"   doesn't work ?

Share this post


Link to post
Share on other sites

AutoIt3.exe "path123.au3"   doesn't work ?

 

It doesn't work as console application - it detaches from console(it is asynchronous ) and there is no output.  

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

This is because AutoIt3.exe is not compiled a console application.

Try using another compiled script as the launcher of your script.

Ensure it is compiled as console and contains this directive:

#pragma compile(AutoItExecuteAllowed, true)

Jos

Thanks! I am not sure how this will work ... since autoit doesn't provide output I may not be able to collect it anyway. Can you give me example how to collect output from autoit in this way?

I believe it will be very helpful to have something like Autoit3console.exe in the installation package.

Thanks

Edited by ndinev

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