Trying to write a very simple batch. The batch checks if there is special criteria kind of files of one location anywhere in other location, and if so DOES NOT copy duplicated files there. Problem is that I want to check file existence not only in DESTINATION folder, but in ANY subfolders of that destination folder. I can use several IF NOT EXIST c:\destination\folder1 IF NOT EXIST c:\destination\folder2 IF NOT EXIST c:\destination\folder3 … etc. But there may be newly created subfolders with names I cannot predict in batch. So how can I extend checking FOR / DO IF NOT EXIST in destination folder and its subfolders?
There is working batch only for DESTINATION folder itself.
FOR %%a IN (c:\source\01????.txt) ^
DO IF NOT EXIST "c:\destination\%%~nxa" ^
COPY "c:\source\%%~nxa" "c:\destination\%%~nxa"
Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire