0

When I run exec('Stop-Process -name chromedriver'); (Stop-Process is a PowerShell command) I get the following error:

'Stop-Process' is not recognized as an internal or external command, operable program or batch file.

I ran by the PHP script containing that line from a PowerShell window with Admin privileges.

Any ideas?

neubert
  • 15,947
  • 24
  • 120
  • 212
  • Exec runs the command as if it's in a regular command prompt, not a powershell session – ADyson Feb 23 '21 at 17:57
  • @ADyson - is there a way to make them run in a powershell session? – neubert Feb 23 '21 at 17:59
  • I just googled "PHP exec powershell" and lots of useful info appeared including the question linked above. Looks like you just need to run powershell.exe and pass it the script. What research did you do before posting? – ADyson Feb 23 '21 at 18:00

0 Answers0