daellio Posted January 2, 2009 Share Posted January 2, 2009 I'm currently using AutoIt v3.2.12.1 and have been scripting for quite some time but only recently noticed a problem with the RunWait() function in that it doesn't properly use the working directory. I've looked at the newest version that was just released (v3.3) in hopes that it was fixed but I didn't see that function mentioned under the 'History' section.Here is the sample script:$InstallDir="C:\MyTempDir"$Ret = RunWait("SomeProgram.exe",$InstallDir,@SW_HIDE)if @error <> 0 then $Ret = @Extended;At this point $Ret will equal 2 and SomeProgram.exe will not have run or installedHowever...This script will work (changes marked in bold):$InstallDir="C:\MyTempDir"$Ret = RunWait($InstallDir & "\SomeProgram.exe",$InstallDir,@SW_HIDE)if @error <> 0 then $Ret = @Extended;this will exit successfully and the program will run/installI thought I'd point this out for future releases but if its something I'm doing wrong then please let me know.-Dan Link to comment Share on other sites More sharing options...
Zedna Posted January 2, 2009 Share Posted January 2, 2009 I think it's not a bug. You must use absolute path every time file is in other then current (@ScriptDir) directory. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
SteveSchumacher Posted October 20, 2017 Share Posted October 20, 2017 Having the same problem with 3.3.12.0. I'm not sure if this is an AutoIT bug or, my environment; I suspect either McAfee or Digital Guardian is perhaps interfering with the honoring of the working directory specified as 2nd arg to RunWait. (Why allow the specification of a working directory if it won't be honored? Makes no sense.) Will try to get both of these products to white-list/exempt my particular program from their attention to see if one is the culprit. I have a number of scripts that I think have worked fine (honored the working directory specified) until DG was recently pushed to my PC. I will update this if I have anything of use to add. Link to comment Share on other sites More sharing options...
Developers Jos Posted October 20, 2017 Developers Share Posted October 20, 2017 Show us en example script where you have issues with and how you have determined that it isn't setting the proper Workdir please. 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 More sharing options...
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