How to Copy a List of Files From One Folder to Another - Windows 10 Batch Script Tutorial

preview_player
Показать описание
Do you have a list of files - perhaps in a text (*.txt) document - that you want to copy from one folder to another? Save yourself time and use a batch script! In this video, I'll show you how to write a bat file which goes through the list and copies each file in turn. It even recreates the exact directory/folder structure of the source in the destination.

TOPICS COVERED:
- Changing the code page (CHCP) of a command prompt console
- Using the FOR /F loop
- Copying directories and files with XCOPY

--
If you enjoyed this video, please SUBSCRIBE to HandyAndy Tech Tips for more tutorials!
Рекомендации по теме
Комментарии
Автор

I was asked to copy more than 300 files in a folder with more than 24k files at my job. I would have to search them individually. This video helped me a lot. Thank you.

iago
Автор

This was exactly what I wanted and it worked really fine. Thanks for the video.

akshayvartak
Автор

pal, I'm a photographer, my clients send me the chosen photos on a text document with the number of the photos, most of the times maybe 300 out of 2000 files, you just saved me hours of manual photo choosing

andrescarrasco
Автор

GREAT EFFORT . THANKS ALOT SIR . THUMS UP

level-khanpur
Автор

when copying the files from the origin folder to the destination folder can we rename them while executing the code? to your example, let's say I want to transfer 4 mp3 folders and in the destination folder I want one to be renamed as rock, another one jazz and so on. In essence what I'm asking is if we can map the origin folder name to a new/different destination name that might vary for each entry. Thank you in advance.

eljeffe
Автор

Thank you HandyAndy! I was able to move 1000+ files with ease. I have a new adaptation to this that I would like your opinion on. How would you be able to take a step further and copy the files to different folders? I.e. The Abba files go into a new destination Abba folder, Motzart files to a new destination Motzart folder all with one script? These new destination folders are predetermined and listed in a corresponding excel spread.

BoscoRemmy
Автор

Thanks Andy,
Which of your filenames is the list of mp3s? or is the script generating the file list? I already have a file list of images, exported from the software I am using. i.e. I have a text document with a list of image files (thousands) I want to move them to somewhere safe so I can delete everything else.

grahamtunnadine
Автор

excellent. I was able to use * for partial match. "files starting with 1*", just one line was able to copy all that fall under the criteria.

nikiss
Автор

thank you it's save my too much time

nickstop
Автор

I have a similar requirement but where your index file contains file names mine contains folder names. So what im looking to do is find the folder name and then copy the folder and contents to a new location. Any idea how to do this?

TheBigshow
Автор

Can you please let me know how can use a variable PATH for which i can assign path of the src folder location

saikishor
Автор

but what if I want just a certain thing from each file to be copied into a new folder ?

skullmammon
Автор

i want copy some file from one folder to another folder .. but i can't do via this way..
can you guide me

Blogs_immi
Автор

For me it says it can't find the file and that 0 files were copied for every song. Any way I could fix this?

poopfarter
Автор

Andy, is there a command I can add to the script to instruct it to overwrite all files that may already exist in the destination folder?

davidoneill
Автор

please make a video about how did you made .txt file, its looks nice.

alyssaaly
Автор

how to do it to a file wich is being used by another process (blocked)

oleof
Автор

the .bat file stays a .txt file for my Win10

florentbenoit
Автор

just type .MP3 in search bar only mp3 files shows to you without folder

AmitDY