Jump to content

RunWait() Bug? "Working Directory" not working...


Recommended Posts

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 installed

However...

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/install

I 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

  • 8 years later...

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

  • Developers

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

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
 Share

  • Recently Browsing   0 members

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