views:

112

answers:

1

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
+3  A: 

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.

BenV
Wow doskey is still around! I never think to use the stuff I learned computers on anymore.
Iznogood
woo works like a charm!!!
jiewmeng
i noticed that this only last for that session, can i make it last forever?
jiewmeng
@jiewmeng: I knew that was coming. I've updated my answer. Feel free to re-accept it :)
BenV