Excluding a directory in for loop's search
问题 I have the following line of code: FOR /R D:\1_FOLDER %f IN (*.jpg,*.png) DO XCOPY %f D:\2_FOLDER /H /C The first problem what i have, the command doesn't run, i get the error Invalid numbers of parametres The second problem in directory 1_FOLDER i have 2 more folders X_FOLDER and Y_FOLDER, i want the for loop to search only in X_FOLDER, and copy only files of the X_FOLDER. I have the second problem same when i want to copy from C:\ , i want to exclude the Windows folder from for loop's