Search code examples
windowsautoit

Program started using Run() is unable to locate its config file


If I run c:\myfile.exe from cmd prompt it works and loads its config file properly. But the same thing using AutoIt has the program start, but then ignores its config file:

Run("c:\myfile.exe")

Why doesn't it run correctly like it does from cmd prompt ?


Solution

  • Helpfile shows:

    Run ( "program" [, "workingdir" [, show_flag [, opt_flag]]] )

    Set the "workingdir" (path to the config file). Your "program" searches in the working directory for its config file. It defaults to the AutoIt script's working directory, which equals @ScriptDir.

    Following your example, it should be:

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