1.用php命令行php
php phar文件bash
2.生成bat文件,在命令行下使用,以composer.phar爲例composer
( 1)在php.exe所在目錄新建composer.bat文件spa
(2)把composer.phar移動到php.exe所在目錄命令行
(3)在php.exe所在目錄打開命令行窗口執行echo @php "%~dp0composer.phar" %*>composer.batcode
echo @php "%~dp0composer.phar" %*>composer.bat