Reputation: 721
I am trying to run a .exe application with input file and argument.
With cmd I can successfully start the executable like this...
C:\Program Files\MyApp.exe "path\to\input file" argument
However, nothing happens when I simply copy paste the string above into the exec() function like this..
exec("C:\Program Files\MyApp.exe "path\to\input file" argument")
Do I need to escape parts of the string? How should I proceed?
Upvotes: 2
Views: 6244
Reputation: 1711
I had to use this format
php -q "./yii.php" migrate/up --interactive=0 --migrationPath=@vendor/pheme/yii2-settings/migrations
Upvotes: 0
Reputation: 238
Just pass the arguments like a normal calling from shell
ex:
exec("C:\Program Files\MyApp.exe \"path to\input file\" argument")
Upvotes: 3