I need to copy only one file from a folder containing only binary files. I don't know the exact name of the file so i am using *.bin as the parameter. But using *.bin will copy all the .bin files to the destination.
Asked
Active
Viewed 907 times
-1
-
1You need to be more specific in what you need. What do you consider as the *first found* file? And you need to show your own efforts in solving this. StackOverflow is not a free code writing service! please learn [how to ask](http://stackoverflow.com/help/how-to-ask)! – aschipfl Jul 14 '16 at 07:32
-
Do you know the name of the file? Then you could replace it `*` by the actual name. Else: Please state how you determine the file to copy and what you wrote so far. – Florian Straub Jul 15 '16 at 08:44
-
Say the src folder contains abc.bin, def.bin, xyz.bin. when i use *.bin in XCOPY it copies all the 3 files to the destination folder. But I need only the first binary file to be copied to the destination folder. i.e to restrict the XCOPY command to copy only one item(any one) with .bin extension not all of them. (I don't the file name) – user1664560 Jul 15 '16 at 12:26
1 Answers
0
Just put the whole file path in to copy it. I would suggest using copy instead of xcopy, because xcopy is made for high volume copying, while copy is built for copying one or two files. In order to do that, you need to specify the file you want to move, and where to move it to, like so:
copy "random.txt" "randomfolder"

Mayhem Jensen
- 15
- 1
- 5