If you have installed XAMPP, and want to use command line to run PHP on Windows, here is how you can do so.
1. Right click on the Computer icon on your Desktop and choose Properties option.
2. In the System window click on Advanced system settings in the left pane as highlighted below
3. In the System Properties window select Advanced tab and click on Environment Variables… button given at the bottom of the window as highlighted below
4. In the Environment Variables window you will notice two columns User variables for a Username and System variables.
5. Under System variables there is a Path variable, click edit
6. At the end of the line, add where you installed your xampp, for my case it is: ‘;C:\xampp\php’
7. Click OK.
Now you can start running Windows Command Line