返回列表 发帖
本帖最后由 BAT1 于 2011-10-4 02:50 编辑

我在X:\ 下面写出来的的,用的时候,请根据自己的实际情况修改一下吧.
  1. @echo off
  2. if not exist "1.txt" echo 1.txt 在哪里?&pause >nul & exit
  3. if not exist "x:\123" md x:\123
  4. if exist 2.txt del 2.txt
  5. for /f "delims=" %%j in (1.txt) do (
  6.    if exist "x:\abc\%%j"  echo  在x:\abc发现%%j & copy "x:\abc\%%j" "x:\123\%%j"
  7.    for /f "delims=" %%i in ('dir /a:d /b /s x:\abc') do (
  8.       if exist "%%i\%%j"  echo  在%%i发现%%j & copy "%%i\%%j" "x:\123\%%j"
  9. ))>nul
  10. echo 已经拷贝指定文件!!!
  11. for /f %%i in (1.txt) do (
  12.    echo %%i
  13.    if not exist "x:\123\%%i"  echo %%i >>2.txt
  14. )>nul
  15. if exist "x:\2.txt" echo 但找不到下例文件:& type 2.txt
  16. pause
复制代码
1

评分人数

TOP

返回列表