本帖最后由 BAT1 于 2011-10-4 02:50 编辑
我在X:\ 下面写出来的的,用的时候,请根据自己的实际情况修改一下吧.- @echo off
- if not exist "1.txt" echo 1.txt 在哪里?&pause >nul & exit
- if not exist "x:\123" md x:\123
- if exist 2.txt del 2.txt
- for /f "delims=" %%j in (1.txt) do (
- if exist "x:\abc\%%j" echo 在x:\abc发现%%j & copy "x:\abc\%%j" "x:\123\%%j"
- for /f "delims=" %%i in ('dir /a:d /b /s x:\abc') do (
- if exist "%%i\%%j" echo 在%%i发现%%j & copy "%%i\%%j" "x:\123\%%j"
- ))>nul
- echo 已经拷贝指定文件!!!
- for /f %%i in (1.txt) do (
- echo %%i
- if not exist "x:\123\%%i" echo %%i >>2.txt
- )>nul
- if exist "x:\2.txt" echo 但找不到下例文件:& type 2.txt
- pause
复制代码
|