Php – SET PATH in batch file

batch-filePHP

I am still getting this error.

>
'php' is not recognized as an internal or external command,
operable program or batch file.

This is how i set the path in my batch file

SET PATH = %PATH%;"C:\wamp\bin\php\php5.5.12\php.exe"

Best Answer

SET PATH=%PATH%;C:\wamp\bin\php\php5.5.12\

You add directory path to the %PATH%, not file path.

Do consider what context you are calling this.

You cannot have a batch file that you load from file Explorer and expect the Environment to be global.

The %PATH% is only updated in the command prompt instance running the batch script.