I would like to run the command line : "php file.php" insted of "C:\xampp\php\php.exe file.php"

I tried to look on registry editor, without success

Could you help me ?

link|improve this question
feedback

migrated from stackoverflow.com Feb 15 '10 at 20:59

This question came from our site for professional and enthusiast programmers.

3 Answers

You can add C:\xampp\php\ to your PATH env variable. Test it out locally by doing this:

C:\>set PATH=%PATH%;C:\xampp\php
C:\>php file.php

In the end, if you want to keep this across multiple cmd sessions, you will need to go into your System dialog in your Control Panel and add it to the Path environment variable there.

link|improve this answer
feedback

You could doskey at a command prompt.

doskey /?

will give you brief help,

doskey php=C:\xampp\php\php.exe $*

will define a macro so that

php file.php

will expand to

C:\xampp\php\php.exe file.php
link|improve this answer
feedback

There is a registry key where you can register applications called App Paths.
See: http://msdn.microsoft.com/en-us/library/ee872121(VS.85).aspx

link|improve this answer
feedback

Your Answer

 
or
required, but never shown