Sign in to follow this  
Followers 0
greenmachine

run error with /autoitexecuteline

10 posts in this topic

Run (@AutoItExe & ' /autoit3executeline "msgbox (, ''hello'', ''hello'')" ')

If you run that code in a script, regardless of whether it has the option for RunErrorsFatal set to 0, or an object event for AutoItError, you get a message box saying it was unable to execute the line. It shouldn't be able to execute it, which is fine, but I'd like to remove that box and replace it with a soft crash, like with runerrorsfatal = 0. Is there a way to let that happen?

Share this post


Link to post
Share on other sites



what about this version:

Run ('"' & @AutoItExe & '" /autoit3executeline "msgbox (0, ''hello'', ''hello'')" ')

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Run (@AutoItExe & ' /autoit3executeline "msgbox (, ''hello'', ''hello'')" ')

If you run that code in a script, regardless of whether it has the option for RunErrorsFatal set to 0, or an object event for AutoItError, you get a message box saying it was unable to execute the line. It shouldn't be able to execute it, which is fine, but I'd like to remove that box and replace it with a soft crash, like with runerrorsfatal = 0. Is there a way to let that happen?

I know the code has a missing 0, that's the point. What I wanted is to not see the error box when I try to run that. I see you also added a few quotes, they don't make a difference. My code works fine with just adding 0, but it wasn't about trying to get it to run correctly... the point was that if it is purposely done wrong, it shows an error message box that I want to know how to remove. Edited by greenmachine

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The following should work but doesn't and I'm calling it a bug that it doesn't work:

Run ('"' & @AutoItExe & '" /ErrorStdOut /autoit3executeline "msgbox (, ''hello'', ''hello'')" ')

The bug is that AutoIt doesn't recognize both arguments that it accepts.

Edit: "2 both" is bad poor grammar (Intentional).

Edited by Valik

Share this post


Link to post
Share on other sites

What you can do is redirect the output to a temp file the way editors redirct it to the debug window.

Share this post


Link to post
Share on other sites

I guess valik axed that one LOL

Share this post


Link to post
Share on other sites

What you can do is redirect the output to a temp file the way editors redirct it to the debug window.

Come on now, that's not how editors do it at all! And since this is obviously a beta related question, the correct way to get the output back if the output is important is to use the I/O re-direction feature of Run() to harvest the data directly. None of that 1998 file redirection crap.

Share this post


Link to post
Share on other sites

Come on now, that's not how editors do it at all! And since this is obviously a beta related question, the correct way to get the output back if the output is important is to use the I/O re-direction feature of Run() to harvest the data directly. None of that 1998 file redirection crap.

Yes valik I was just studying that... My thinking is a bit ancient LOL. I tried running your code snip in compiled form.

Run ('"' & @AutoItExe & '" /ErrorStdOut /autoit3executeline "msgbox (, ''hello'', ''hello'')" ')

Compiled autoit will infinitely respawn itself with or without the msgbox fixed.

Definately a bug...

Share this post


Link to post
Share on other sites

Same thing with version 3.1.1 and 3.1.101

Share this post


Link to post
Share on other sites

The following should work but doesn't and I'm calling it a bug that it doesn't work:

Run ('"' & @AutoItExe & '" /ErrorStdOut /autoit3executeline "msgbox (, ''hello'', ''hello'')" ')

The bug is that AutoIt doesn't recognize both arguments that it accepts.

Run ('"' & @AutoItExe & '" /ErrorStdOut /autoit3executeline "msgbox (, ''hello'', ''hello'')" ')

That code fails because once it encounters /ErrorStdOut, it looks for a file, not more command line parameters. It needs to continue processing the command line to make sure none of the other supported options are specified. The above should attempt to run a mal-formed line of AutoIt code and silently fail because of the /ErrorStdOut argument.

Well it's good to know that it is easy to have a silent fail and that the bug will be fixed soon. Thanks Valik.

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
Sign in to follow this  
Followers 0