
對比兩個文件夾里文件找出其中一個文件夾里缺少的文件并從另一個文件夾里復(fù)制過來最后由 ditto 于 -11-21 14:00兩個目錄C:test 和 D:test ,都沒有子目錄正常情況下,兩個目錄文件是一樣的,但是d:test偶爾會缺少部分文件,C:test下的文件比D:test文件多,想把D:test缺少的 文件 拷貝過來請問如何實現(xiàn)?
第2 部分for好像不能正常處理 只能顯示c:nclick="copycode($('code0'));">復(fù)制代碼
- @echo off
- setlocal enabledelayedexpansion
- del tmp.txt
- for /r c:test %%f in (*.*) do (
- set file =%%~ff
- echo %%~ff>>tmp.txt
- )
- for /f delims=,tokens=*%%i in (c:tmp.txt) do (
- rem for /f delims=%%i in (tmp.txt) do (
- rem if not exist d:test%%i%%j copy c:test%%i%%j d:test%%i%%j
- echo %%i %%j
- )
- pause

