Jump to content

Strange behavior when running script from command line


ndinev
 Share

Recommended Posts

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

  • Developers

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

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

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