I have a few files and directories, (all directories contain files):
C:\\ABC │ file1.txt │ ├───folder1 │ oneormorefiles.ext │ ├───folder2 │
I would suggest this as a possibile alternative to using FOR loop and/or a mixture of DEL and RD:
FOR
DEL
RD
MD "%TEMP%\$_.dummy"&&ROBOCOPY "%TEMP%\$_.dummy" "C:\abc" /E /XD logs /PURGE>NUL 2>&1&RD "%TEMP%\$_.dummy"