In a batch file I have this code for copying files:
FOR /F "tokens=*" %%f IN ('DIR /S /B *.png,*.jpg,*.pneg,*.jpeg') DO ( XCOPY /H /S /Y /EXCLUDE:%EXFdestination%\EXF.txt %%~f "%destination%\" ) Problem is it doesn't copy files with spaces in the filenames like D:\Exemple Directory\file.jpg, it only copies files that have filenames like D:\ExampleDirectory\file.jpg
I tried instead of tokens=* with delims= but it doesn't solve the problem.