Registering a new command with dos...?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to register 'php' as a command in dos (cmd) so when i type something
like this php test.php the command will execute something like this:
D:\php\php.exe -f test.php

Any ideas on how to do that?
 
Gray said:
I want to register 'php' as a command in dos (cmd) so when i type something
like this php test.php the command will execute something like this:
D:\php\php.exe -f test.php

Any ideas on how to do that?

This is a recipe for eternal confusion: Depending
on where you run php from, you will get a different
response. A far better way goes like this:

1. Click Start / Run
2. Type notepad %SystemRoot%\MyPHP.bat
3. Type these lines:
@echo off
D:\php\php.exe -f "%*"
Now save and close the file.

To invoke this batch file, type this from a Command
Prompt: MyPHP c:\test.php

And please note that DOS is an operating system. There
is no DOS under WinXP, only the Command Prompt
(which in some ways emulates DOS).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top