Jump to content

Recommended Posts

Posted

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

Posted

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!

  • Solution
Posted

 - 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")

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...