-1
$pid = Run('"' & $executable & '"' & $flags & ' "' & $somefile & '"',  @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD)

The AutoIt Run() function doesn't work, $pid is set to 0 and @error to 1.

BotOfWar
  • 588
  • 5
  • 14

1 Answers1

0

The Run ( "program" [, "workingdir" [, show_flag [, opt_flag]]] ) function[1] has a total of 4 parameters, if you leave out the workingdir by mistake then it will not work as expected and set @error to 1

The correct function call would have been:

$pid = Run('"' & $executable & '"' & $flags & ' "' & $somefile & '"', "",  @SW_HIDE, $STDOUT_CHILD+$STDERR_CHILD)

The working dir is not specified there, which is not recommended, but I did not require it for my use-case.

BotOfWar
  • 588
  • 5
  • 14