
CODE: [Copy to clipboard]請教﹐在處理上面BAT時﹐2K的OS提示不能識別choice命令﹐故希望各位DX能幫忙用FOR或其它命令來代替上面的CHOICE功能。。。謝謝~~@echo off
choice /c:dme defrag,mem,end
if errorlevel 3 goto defrag
if errorlevel 2 goto mem
if errotlevel 1 goto end
:defrag
c:\dos\defrag
goto end
:mem
mem
goto end
:end
echo good bye
CODE: [Copy to clipboard]大概是这个样子吧,你自己再根据实际情况完善。@echo off
cls
set input=
:_loop
echo ======== Menu =======
echo d. defrag
echo m. mem
echo e. end
echo ===================
set /p input=Please make your choice(d/m/e):
if /i [%input%]==[d] goto _defrag
if /i [%input%]==[m] goto _mem
if /i [%input%]==[e] goto _end
goto _loop
:_defrag
...
goto _end
:_mem
...
goto _end
:_end
...
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |