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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
cmdman
Posts: 1
Joined: 18 Nov 2018 08:44

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

#1 Post by cmdman » 18 Nov 2018 09:10

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

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

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

#2 Post by aGerman » 18 Nov 2018 10:22

Code: Select all

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

Post Reply