本帖最后由 guaiwu 于 2011-10-4 23:52 编辑
回复 8# guaiwu
听取CrLf 的意见,加了班 到了12点终于研究出来粗成果。
参考下现在的效果- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%a in (1.txt) do (
- for /f "delims=" %%i in ('dir /s /b e:\abc') do (
- echo %%~nxi | findstr %%a &&echo f | xcopy "%%~fi" "e:\123\%%~nxi" /s
- ))
- set str1=dir /b E:\123
- set str2=dir /b E:\abc
- for %%a in ("%str1%" "%str2%") do (
- set /a b+=1
- for /f "delims=" %%i in ('%%a') do (
- set /a a+=1
- set _!a!=%%~nxi
- )
- set .!b!=!a!
- )
- set /a c=!.1!+1
- for /l %%i in (1,1,%.1%) do (
- for /l %%j in (!c!,1,%.2%) do (
- if !_%%i! equ !_%%j! (
- set _%%i= -
- )))
- for /l %%i in (1,1,%a%) do echo !_%%i!>>error.txt
- pause
复制代码 见到FOR做出的,没办法人家的水平只能到这。 别见笑 |