How to copy files in batches under Windows

  
                                                                                                                                                                                         

Find out some of the specific files from a bunch of files (I'm talking about the files ^_^ on the computer
). Ah, think about it. In fact, we only need a few mouse clicks, and the rest of the work is handed over to the computer
. What to do, we need to use batch (bat). Maybe you think that you don't understand the code and you are shrinking. In fact, what is the relationship? I don't know much. I will use it. Let's take a look at how it is done.

Now I have a bunch of files, I want to find out 1.txt, 2.txt, 4.txt, 9.txt.


First you need to copy the following code into a text document, then save it and change the suffix from .txt to .bat. In this case I will name it copy .bat. (Note that this code has only four lines, the third line of code is relatively long, may be divided into multiple lines due to display problems, must pay attention when using)

@pHO OFF

mkdir % ~dp0copy 2>nul

FOR /F"TOKENS=*" %%A IN ( 'more copy.txt') DO ( xcopy %~dp0%%A %~dp0copy /y /q 1> Nul)

PAUSE

Then fill in a list of files to be copied into a text file. Then name it copy.txt. There are no spaces in the list. (Excel columns can be copied directly into the text file, I usually use it.)

Next, copy the prepared copy.bat and copy.txt to the folder where the file is located. And then double-click copy.bat.

At this time, a black box will pop up. Maybe you just noticed it. There is a 9.txt in the list. Actually, there is no, don't worry, the applet will prompt you, the file is not found. Will be listed. In addition, if you need to copy more files, you may need to wait for a while, you must wait to see “ please press any key to continue... & rdquo; then close, do not turn off the black frame in advance, or else The file is not copied.

After the program is executed, you will find that there is a copy folder in the folder. Open, inside is the file you want.

It’s just a small application for batch processing. For those who don’t know, provide some tips. Don’t spray, please.

If you have any cumbersome work steps in your usual office, you can also come up with a good way to communicate.



Copyright © Windows knowledge All Rights Reserved