Forwarding all batch file parameters to inner comm

2019-03-17 13:25发布

For my comfort in Windows, I want to prepare some PHP tools launched like in Unix.

f.e.: composer create-project symfony/framework-standard-edition path/

Not: php composer.phar create-project symfony/framework-standard-edition path/

I made composer.bat file in system path dir:

php C:\path\to\composer\composer.phar

and its works in simply usage. But how to forward all parameter and flags to command inside?

2条回答
爷、活的狠高调
2楼-- · 2019-03-17 14:05

in your batch file composer.bat, simply put:

php C:\path\to\composer\composer.phar %*
查看更多
祖国的老花朵
3楼-- · 2019-03-17 14:05

windows gives you %* to refer to all parameters.

Your new composer.bat file will then become
php C:\path\to\composer\composer.phar %*

查看更多
登录 后发表回答