Hello gurus,
I am facing the below issue.
I have some files in directory Dir_1 , and I need to copy them in another directory Dir_2.
Well, here I go.
I thought this would have done the job, but it isn’t.
What am I missing?
@echo off & setLocal EnableDELAYedeXpansion pushd D:\Dir_1 for /F %%j in (dir D:\Dir_1 /A-D | find /c "OK_ARCHIVE") do set Count=%%jdo set Count=%%j if %count% EQU 0 ( echo No files found in the specified folder>>FilesError.log ) else ( for /L %%b in (1 1 %count%) do ( xcopy "D:\Dir_1" "G:\Dir_2" /D /I /Y) echo A total of !count! files have been copied>>FilesSuccess.log ) move FilesSuccess.log D:\Dir_3 move FilesError.log D:\Dir_3
after executing, I am getting
| was unexpected at this time.
Please help,
Thnx and regards
1 Answer