Sign in to follow this  
Followers 0
Andy2k14

ErrorStdOut help

6 posts in this topic

Hi All,

Noob here trying to figure out this annoying problem.

i am using AutoIT to run an .exe. I have managed to create the code and successfully open my .exe application. However what i have noticed is there is a difference in how my application runs depnding whether i manaully open it using the mouse or use AutoIt to open the .exe.

The same directory is used each time.

I cant understand why my application would run differently when called from Autoit but run fine when manully opening the program. Very strange.

Although it looks like my script has worked, in the script editor i noticed it comes out with an ErrorStdOut  message.

also i have ran the AutoIt windows tool to look at class names and everything is identical except the handler number. If i manually open my .exe the handler is different to that when i open it through AutoIt.

 

Has anyone seen this before?

thanks

Share this post


Link to post
Share on other sites



you should post your code - it's a bit hard to debug something we can't see :)


FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Share this post


Link to post
Share on other sites

Ok, here the code. Its not much.

#include <Constants.au3>#include <MsgBoxConstants.au3>
 
run("C:\MyApp\MyApp.exe")
 
Exit

Things i dont understand:

How is calling the App in AutoIT different to manually opening the App with the mouse. Same location and everything.

Are there any tools i can look at to see what windows is doing to try and debug this?

The App loads in both instances yet only the manual open detects the drivers associated with the App and works as intended.

I am lost!

Share this post


Link to post
Share on other sites

 - When you start your program manually (from the explorer), the working directory is set to the directory where the file is stored.

 - When you launch your program with AutoIt with Run or ShellExecute without specifying the working directory (as you did), the working directory is set to the current directory of the calling script.

Try to set the working directory in your Run command.

Run("C:\MyApp\MyApp.exe", ""C:\MyApp")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

You sir are a legend!

Edited by Andy2k14

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