有个关于模拟控制台的- @echo off&echo.&echo.&setlocal enabledelayedexpansion
- Set app="%~dpnx0"&set "con=2>nul"
- :top
- set /p input="%cd%>"
- if not defined input goto :top
- call :_%input:/?=% %con%||%input% %cons%
- set input=
- goto :top
-
-
- :_? 显示帮助
- help&echo.---------------ADD---------------
- for /f "tokens=1* delims=_" %%a in ('findstr /b ":_" %app%') do echo.%%b
- echo.&set errorlevel=0
- goto :eof
-
- :_oerr 内部错误信息开关
- if defined con (set con=) else set "con=2>nul"
- goto :eof
-
- :_terr 外部错误信息开关
- if definde cons (set cons=) else set "cons=2>nul"
- goto :eof
-
- :_err 所有错误信息开关
- if /i "%1" == on set con=&set cons=
- if /i "%1" == off set "con=2>nul"&set "cons=2>nul"
- goto :eof
-
- :_MPP Test............
-
- goto :eof
-
- :_MENU 菜单
- Set str=1.百度 4.搜搜 7.雅虎~2.谷歌 5.搜狗 8.比比猫~3.狗狗 6.有道 9.微软LIVE
- for /f "tokens=1-3 delims=~" %%i in ("%str%") do echo %%i&echo %%j&echo %%k
复制代码
|