
CODE: [Copy to clipboard][ Last edited by Hanyeguxing on 2009-6-27 at 06:53 ]::该批处理没有经过全面测试
::在这里,每次需要关闭 C:\程序.exe 才进入下一循环,如果不想这样,使用start。
::由于fc 问题太多,这里没有使用他进行比较。
::工作前提条件为,c:\已更新.txt 的内容是A.txt的一部分,切记!
::%xing%设置关键词,确保原始的c:\已更新.txt和A.txt文件中没有“寒夜孤星”四个字,否则请更换
@echo off
set xing=寒夜孤星
for /f "delims=" %%i in (c:\已更新.txt) do echo %%i>>han.txt
echo %xing%>>han.txt
for /f "delims=" %%i in (A.txt) do echo %%i>>han.txt
for /f "delims=" %%i in (han.txt) do (
if not defined %%i set %%i=A & echo %%i>>ye.txt
)
del han.txt /q /f
for /f "delims=:" %%i in ('findstr /n .* ye.txt ^|findstr /r /c:"%xing%"') do set gu=%%i
echo [更新]>C:\B.ini
for /f "skip=%gu% delims=" %%i in (ye.txt) do (
"C:\程序.exe"
echo 源目录=D:\%%i>>C:\B.ini
echo 目标目录=E:\%%i>>C:\B.ini
echo %%i>>c:\已更新.txt
)
del ye.txt /q /f
| Quote: | |
|
CODE: [Copy to clipboard][ Last edited by tireless on 2009-6-27 at 09:48 ]@echo off
set ?list="A.txt"
set ?ini="C:\B.ini"
set ?app="C:\程序.exe"
set ?log="C:\已更新.txt"
for /f "usebackq eol= delims=" %%a in (%?log%) do set %%a=.
for /f "usebackq eol= delims=" %%a in (%?list%) do (
if not defined %%a (
echo [更新]
echo 源目录=D:\%%a
echo 目标目录=E:\%%a
%?app%
echo;%%a>>%?log%
) > %?ini%
)
| Quote: | |
|
CODE: [Copy to clipboard]For /f "usebackq eol= delims=" %%a in (!TBLog!!ha!需要更新.txt) do (
if not defined %%a (
for %%? in (H K N Q) do (
echo [更新]
echo 远程目录=D:\网络游戏\%%a
echo 本地目录=%%?:\网络游戏\%%a
原调用.exe
) > cfg.ini
echo;%%a>>!TBLog!!ha!已更新.txt
)
)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |