Exclude folders in batch-copy-script

前端 未结 2 1698
予麋鹿
予麋鹿 2021-02-08 23:20

I am using a batch file on a USB stick to backup my pictures. I use the following command:

for /r C:\\ %%x in (*.jpg *.png *.gif) do @copy /y %%x .
2条回答
  •  故里飘歌
    2021-02-09 00:11

    Turn copy into xcopy and then you can use it's /EXCLUDE switch

    @xcopy %%x /y /EXCLUDE:\WINDOWS\
    

    See xcopy /? for the details.

提交回复
热议问题