如题。
请各位高手帮忙!
[ Last edited by willsort on 2006-4-10 at 12:35 ]
请各位高手帮忙!
[ Last edited by willsort on 2006-4-10 at 12:35 ]
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
Originally posted by martin325 at 2006-2-27 11:48:
比如:
在autoexec.bat中当执行到
choice /c:a/n
时,一定得输入字符a,才会继续往下执行,否则10秒后就自动再次运行autoexec.bat本身。
Originally posted by martin325 at 2006-2-27 11:48:
比如:
在autoexec.bat中当执行到
choice /c:a/n
时,一定得输入字符a,才会继续往下执行,否则10秒后就自动再次运行autoexec.bat本身。
choice /c:an /t:n,10 /n
if errorlevel 2 autoexec.bat
:: continue
:: ChoiceX.asd - Choice 扩展 DEBUG 汇编脚本
:: Will Sort - 14:48 2005-5-15 - Debug
:: Modifition:
:: 1.Not terminates timeout when press invalid choice key
:: 2.press ESC to terminate timeout
:: 3.press CR or SPACE to choose default choice key
a 047D
JNZ 0482 ; Call 0A80 when press control key
CALL 0A80 ; get second byte of scancode of control key
CALL 0A85 ; process event of press ESC, CR, SPACE
a 04A2
JMP 0451 ; Not terminate timeout when press invalid choice key
a 0A80
MOV AH,08 ; get char again
INT 21
RET
CMP AL,1B ; if press ESC
JZ 0A94 ; YES, terminate timeout
CMP AL,0D ; if press CR
JZ 0A91 ; Yes, goto set default choice
CMP AL,20 ; if press SPACE
JNZ 0A99 ; No, goto return
MOV AL, ; set default choice
MOV BYTE PTR ,00 ; set timeout is zero
RET
n ChoiceX.com
w
q
:: Please reserved this line.
:: ModChc.bat - 扩展 choice.com 的缺省按键功能
:: Will Sort - 2005-5-15 - CMD@WinXP
@echo off
if "%1"=="Error:" goto Error
:SysInit 设置 NT 命令行代码页,修正中文显示
if not "%OS%"=="Windows_NT" goto Locate
chcp 437>nul
graftabl 936>nul
:Locate
if exist ChoiceX.com %0 Error: Found ChoiceX.COM / 错误:已存在ChoiceX.COM
echo Locating script . . . 定位修改脚本 . . .
echo.
if not exist ChoiceX.asd %0 Error: Not found script / 错误:未找到修改脚本
echo Locating CHOICE.COM . . . 定位 CHOICE.COM . . .
echo.
if exist %windir%\command\choice.com set ChcLoc=%windir%\COMMAND
for %%p in (%path%) do if exist %%p.\choice.com set ChcLoc=%%p.
if exist %1.\choice.com set ChcLoc=%1.
if "%ChcLoc%"=="" %0 Error: Not found CHOICE.COM / 错误:未找到CHOICE.COM
:CheckIn
echo Checking CHOICE.COM . . . 验证 CHOICE.COM . . .
echo.
dir %ChcLoc%\choice.com | find "22:22"> nul
if errorlevel 1 %0 Error: Invalid CHOICE.COM / 错误:无效的CHOICE.COM
echo Located to %ChcLoc%\CHOICE.COM, Modify?
echo 定位到 %ChcLoc%\CHOICE.COM, 是否修改?
echo.
echo Cancel: press Ctrl+C key 取消: 请按Ctrl+C键
echo Continue: press other key 继续: 请按其它键
echo.
pause > nul
:Modify
Echo Modifying CHOICE.COM . . . 修改 CHOICE.COM . . .
echo.
copy %ChcLoc%\choice.com ChoiceX.com > nul
debug ChoiceX.com < ChoiceX.asd > nul
:CheckOut
Echo Checking new ChoiceX.COM . . . 验证新的 ChoiceX.COM . . .
echo.
if not exist ChoiceX.com %0 Error: Modification failed / 错误:修改失败
echo Modification passed ! 修改成功 !
goto End
:Error
echo %1 %2 %3 %4 %5 %6 %7 %8 %9
echo.
:Clear
for %%e in (ChcLoc ChsScr) do set %%e=
:End
echo Press any key to exit 按任意键结束
pause>nul
