diff --git a/src/Command.php b/src/Command.php index 5b9ed1d..f184b1e 100644 --- a/src/Command.php +++ b/src/Command.php @@ -142,7 +142,13 @@ public function setOptions($options) */ public function setCommand($command) { - $this->_command = $this->escapeCommand ? escapeshellcmd($command) : $command; + if ($this->escapeCommand) { + $command = escapeshellcmd($command); + } + if ($this->getIsWindows()) { + $command = sprintf('cd %s && %s', escapeshellarg(dirname($command)), basename($command)); + } + $this->_command = $command; return $this; }