简体   繁体   中英

Windows Shell Script to scan folder & copy file

I would like to loop throught folder & its subfolders & start scnanning and copying a file to specific location within each folder

Regards,

Sorry, can't comment with less than 50 reputation, have to answer instead.

Are you looking for a certain file type to copy or you want to copy everything from one folder to another? Or, if you find a file of interest, you want to create a new folder and copy it to there?

If you could specify these things, it will be a little easier to provide an answer.

Thanks, Tim.

As per my understanding you have to copy a specific file or file type into a specific dir.

You can try find command with copying specific file into your directory .

find /source_dir/ -type f -name "filename_or_type" -exec cp -t /destination_dir/ {} \\;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM