一个倒数十秒备份、可以任意键中断的bat:- @echo off
- echo %cmdcmdline%
- if "%~1"=="按任意键退出" goto :%1
- >"%temp%\.sub" cd.
- start "" /b %0 按任意键退出
- set 退格键=
-
- for /l %%a in (10 -1 1) do (
- set /p =%退格键%%%a 秒后开始备份文件... [按任意键退出] <nul
- if not exist "%temp%\.sub" exit
- ping -n 2 127.1 >nul
- )
-
- echo,
- echo 备份完成。
-
- echo 按任意键退出...
- exit
-
- :按任意键退出
- pause >nul
- del "%temp%\.sub"
- exit
-
- pause
复制代码
|