
CODE: [Copy to clipboard]@echo off
if not "%1"=="" call %*
del "%temp%\#" 2>nul
start /b %~fs0 :aa
echo.&echo 1.打开c盘 2.打开d盘
echo.&set/p var=请输入:
if exist "%temp%\#" (del "%temp%\#"&exit)
>"%temp%\#" type nul&ping -n 2 127.1>nul
goto :%var%
:1
start c:\&exit
:2
start d:\&exit
:aa
for /l %%a in (10 -1 0) do (
title 倒计时 %%a 秒,无选择将打开 c 盘...
if exist "%temp%\#" (
del "%temp%\#"
title 用户已作选择...
exit
)
ping -n 2 127.1>nul
)
>"%temp%\#" type nul&start c:\&title 回车退出...&exit
| Quote: | |
|
| Quote: | |
|
CODE: [Copy to clipboard]@echo off
if not "%1"=="" call %*
del "%temp%\#" 2>nul
start /b %~fs0 :aa
echo.&echo 1.打开c盘 2.打开d盘
echo.&set/p var=请输入:
>"%temp%\#" type nul
goto :%var%
:1
start c:\&exit
:2
start d:\&exit
:aa
for /l %%a in (10 -1 0) do (
title 倒计时 %%a 秒,无选择将自动打开 c 盘...
if exist "%temp%\#" (
del "%temp%\#"
title 用户已作选择...
exit
)
ping -n 2 127.1>nul
)
start c:\&title 回车退出...
for /f "tokens=2" %%a in ('tasklist /fi "windowtitle eq 回车退出..." /nh') do (
taskkill /f /pid %%a
)
exit
CODE: [Copy to clipboard]@echo off
if not "%1"=="" call %*
del "%temp%\#" 2>nul
start /b %~fs0 :aa
echo.&echo 1.打开c盘 2.打开d盘
:agn
echo.&set "var="&set/p var=请输入:
>"%temp%\#" type nul
for %%a in (1 2) do (if "%%a"=="%var%" goto :%var%)
del "%temp%\#"&echo "%var%"是错误的选择!&goto :agn
:1
start c:\&exit
:2
start d:\&exit
:aa
for /l %%a in (10 -1 0) do (
title 倒计时 %%a 秒,无选择将自动打开 c 盘...
if exist "%temp%\#" (
del "%temp%\#"
title 用户已作选择...
exit
)
ping -n 2 127.1>nul
)
start c:\&title 回车退出...
for /f "tokens=2" %%a in ('tasklist /fi "windowtitle eq 回车退出..." /nh') do (
taskkill /f /pid %%a
)
exit
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |