Page 1 of 1

Need help in copying files with certain fixed characters at the end to another folder

Posted: 18 Nov 2018 09:10
by cmdman
Hi,

I have few files ending with certain fixed character and need to copy those files to a different folder. I need help in writing a batch script for this.

Souce:
xxxabcd.xlsx
abc.pdf
hsakd.pdf
ty.xlsx
ertabcd.xlsx

So i need to copy the files ending with *abcd.xlsx in a different folder.

Thanks

Re: Need help in copying files with certain fixed characters at the end to another folder

Posted: 18 Nov 2018 10:22
by aGerman

Code: Select all

@echo off
for %%i in ("*abcd.xlsx") do copy "%%i" "C:\another folder\"
Steffen