Andy2k14 Posted May 12, 2014 Posted May 12, 2014 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
iCode Posted May 12, 2014 Posted May 12, 2014 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)
jguinch Posted May 12, 2014 Posted May 12, 2014 A difference can be the working directory. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Andy2k14 Posted May 13, 2014 Author Posted May 13, 2014 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 jguinch Posted May 13, 2014 Solution Posted May 13, 2014 - 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") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
Andy2k14 Posted May 13, 2014 Author Posted May 13, 2014 (edited) You sir are a legend! Edited May 13, 2014 by Andy2k14
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now