1.

Solve : find and copy?

Answer»

I am trying to find a list of files using wildcards (*.abcd.*) and copy them to another location. I am using xcopy to do that but the problem is that the directory has about 60000 files and it is taking for ever for me to run the batch file.

Is there anyway that I can have it to go and search for the second file in the list once it found an instance of the first file.

xcopy "c:\abcd*.r" "d:\"
xcopy "c:\efgh*.r" "d:\"

I WOULD be GLAD to know if there is any other efficient way to do it.

Thank you,

SrinivasNot really. With 60,000 files you can't expect miracles. If the C: and D: drive are different physical drives, it probably runs FASTER than if C: and D: are logical drives on the same disk. Anything that involves physical I/O tends to be slow since much is happening behind the scenes.

Be patient. Thanks for the reply. Is there anyway that I can stop it from looking through the entire directory once it finds the first occurance. I know for sure there is only one file that matches the pattern.

SrinivasIf you know for sure there is only one file, lose the wildcards and type the fully qualified name. Either way it probably won't make a nanosecond of difference. I/O operations use the file system index to find the file. If you have other I/O intensive programs running concurrently with your batch file, speeds will be reduced.

Even with the fastest disks, I/O tends to be a BOTTLENECK. 8-)



Discussion

No Comment Found