
CODE: [Copy to clipboard]@echo off&setlocal enabledelayedexpansion
set "xing=C:\update_log.txt"
echo a|xcopy "\\服务器路径" "C:\本机路径" /cfskrh>han.ye 2>&1
for /f "tokens=1* delims=>" %%a in (han.ye) do call:han "%%a" "%%b"
if "%gu%"=="" >>%xing% echo 恭喜你,本机已经在“%date% %time%”更新了所有文件
del /q han.ye
exit
:han
set han=%~1
if "%han:~0,3%"=="改写 " goto:ye
if "%han:~0,3%"=="复制了" goto:ye
(if "%han:~0,3%"=="共享侵" (
if "!gu!"=="" echo 有以下文件因被本地程序占用未成功更新(%date% %time%):
echo !ye:~1!
set gu==
))>>%xing%
:ye
set ye=%~2
CODE: [Copy to clipboard]@echo off&setlocal enabledelayedexpansion
::设置日志
set "xing1=C:\update_log.txt"
::设置复制列表
set "xing2=C:\1.txt"
::设置错误消息组
set "@共享侵=="
echo a|xcopy "\\服务器路径" "C:\本机路径" /cfskrh>han.ye1 2>&1
for /f "tokens=1* delims=>" %%a in (han.ye1) do call:han "%%a" "%%b"
if "%gu%"=="" >>%xing1% echo 恭喜你,本机已经在“%date% %time%”更新了所有文件
>>%xing2% findstr /v /l /g:han.ye2 han.ye3
del /q han.ye*
exit
:han
set han=%~1
set han=%han:~0,3%
if "%han%"=="改写 " goto:ye
if "%han%"=="复制了" goto:ye
if defined @%han% (
if "!gu!"=="" >>%xing1% echo 有以下文件因被本地程序占用未成功更新(%date% %time%):
>>%han.ye2% echo !ye:~1!
set gu==
) else >>han.ye3 echo %~2
:ye
set ye=%~2
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |