『第 7 楼』:
使用 LLM 解释/回答一下
@echo off
set /a 日期 = %date:~0,4%%date:~5,2%%date:~8,2%
set /a 时间 = %time:~0,2%%time:~3,2%%time:~6,2%
echo 欢迎来到中国DOS联盟! >%日期%%时间%.txt
cls
echo 按任意键开始复制文件...
pause>nul
:copy
copy %日期%%时间%.txt %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.txt >nul
set /a num = %num% + 1
set string=已复制文件%num%次,要取消请按确定...
msg %username% /time:10 /w %string% >nul && set /a hflag = %time:~6,1% && set /a lflag = %time:~7,1%
set /a new = %time:~6,2%
if %hflag% == 5 set /a hflag = 0 && set /a new = %new% + 10
set /a old = %hflag%%lflag%
set /a flag = %new% - %old%
if %flag% LSS 10 goto :eof
goto copy
XP下运行,需要开启TermService服务(一般默认都是开启的),如果不是你可以修改:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService下的START键。。。
运行后先会生成你要求1里面要求的文件,然后提示你按任意键开始复制文件(要求2)
,如果你按下回车后就会弹出一个对话框提示你正在复制文件的信息,如时间(标题上),次数等等。。。如果你不想复制了只要点一下确定就OK了,命令行也会自动退出。。
@echo off
set /a 日期 = %date:~0,4%%date:~5,2%%date:~8,2%
set /a 时间 = %time:~0,2%%time:~3,2%%time:~6,2%
echo 欢迎来到中国DOS联盟! >%日期%%时间%.txt
cls
echo Press any key to start copying files...
pause>nul
:copy
copy %日期%%时间%.txt %date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.txt >nul
set /a num = %num% + 1
set string=File has been copied %num% times, click OK to cancel...
msg %username% /time:10 /w %string% >nul && set /a hflag = %time:~6,1% && set /a lflag = %time:~7,1%
set /a new = %time:~6,2%
if %hflag% == 5 set /a hflag = 0 && set /a new = %new% + 10
set /a old = %hflag%%lflag%
set /a flag = %new% - %old%
if %flag% LSS 10 goto :eof
goto copy
Run under XP, need to enable the TermService service (usually enabled by default), if not, you can modify: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService the START key...
After running, it will first generate the file required in requirement 1, then prompt you to press any key to start copying files (requirement 2). If you press Enter, a dialog box will pop up to prompt you with information about the file being copied, such as time (in the title), number of times, etc. If you don't want to copy, just click OK, and the command line will exit automatically.
|