echo脚本

来源:互联网 发布:java有参的构造方法 编辑:程序博客网 时间:2024/06/05 06:52


具体操作:
1. 编写个批处理文件"test.bat", 放到"C:/Documents and Settings/Administrator"目录下.
2. 进入cmd, 执行dos命令. 比如: test tdx 或者 test xj. 即可执行对应的程序.

test.bat 代码如下:
-----------------------------------------------------------------------------------
@ECHO OFF

IF '%1'  == 'tdx'     goto tdx
IF '%1'  == 'yf'       goto yf
IF '%1'  == 'we'    goto we
IF '%1'  == 'xj'      goto xj
IF '%1'  == 'zh'     goto zh
IF '%1'  == 'fjxy'   goto fjxy

echo "test [tdx|yf|we|xj|zh|fjxy]"
goto end

:tdx
 cd C:/Program Files/jcb_lh_yf/
 TDXW
 goto end

:yf    
 cd C:/Program Files/jcb_lh_yf/易发/bin/
 YfWt
 goto end

:we
 cd C:/Program Files/KONAMI/Winning Eleven 7I/
 we7
 goto end

:xj
 cd C:/Program Files/Game/StarCraft/
 starcraft
 goto end

:zh
 cd C:/WINDOWS/system32/
 PersonalBankPortal
 goto end

:fjxy
 cd C:/Program Files/Netease/richman/
 richman
 goto end

:end
 cd C:/Documents and Settings/Administrator/
 echo good bye 

-----------------------------------------------------------------------------------