Jiew Meng
Jiew Meng

Reputation: 88187

Using PHP doctrine CLI easily in windows

in windows, to use doctrine CLI from any directory i need to use something like

php D:\full\path\to\doctrine\bin\doctrine.php --variables here

is there anyway i can shorten this so that it becomes something like

php doctrine.php --variables here

or even

doctrine --variables here

Upvotes: 3

Views: 2382

Answers (1)

BenV
BenV

Reputation: 12452

Try doskey doctrine=php D:\full\path\to\doctrine\bin\doctrine.php $*

Then you should be able to do doctrine --variables here

If you don't want to type that out every session, you can export it to a file:

doskey /macros > macros.txt

And import it every session:

doskey /macrofile=macros.txt

And if that's still too much work, you can add them to the Autorun entry for the CLI:

reg add "hkcu\software\microsoft\command processor" /v Autorun /t reg_sz /d "%systemroot%\system32\doskey.exe /macrofile=path\to\your\macros.txt"

Note that by doing this you are modifying your registry, so use caution.

Upvotes: 5

Related Questions