Saved Bookmarks
| 1. |
Solve : XCOPY matching data to same drive (loopback) issue? |
|
Answer» I have found an interesting issue where when trying to sweep the C: drive for *.xls files with XCOPY and write a copy of these matching files to the C: that it appears that after XCOPY finds a match it doesnt progress forward, but instead starts back at root and then hits the same data again and again in a loop. Any suggestions on how to fix this other than use an alternate physical drive. I thought a mapped drive of Y: to a folder of 000 WOULD do the trick. But it fixed the Cyclic Error of an XCOPY of C: to C:, but now is looping back on itself as seen below. If there is no fix by an advanced batch routine I could use a thumb drive as a TEMPORARY storage location for matches and then have the batch write this data back from the thumb drive to the C: in folder 000 after the XCOPY has completed. But then I would also have to know what drive letter the USB device will be using for multiple systems and not sure if there is a easy WAY to find the USB device without stating IF EXIST for the drive mount until it hits the correct one or a % % that I am unaware of to specify the thumb drive device. C:\DataX3>net use y: \\3ghz\c$\000 The COMMAND completed successfully. C:\DataX3>xcopy c:\*.xls y:\xls\*.* /s/d/y C:\file3.xls C:\000\xls\file3.xls C:\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\file3.xls C:\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\000\xls\file3 .xls Terminate batch job (Y/N)? use Code: [Select] for /R FBThanks for the pointer in the right direction Fireballs. I created some bogus files like A.txt B.txt and C.txt and planted them in different locations on the C: and they all were copied back to the test123. Then ran again to make sure it wouldnt feed on itself in a loop and it didnt. The FOR /R routine works much better not looping back on itself. @FOR /R %%G IN (*.txt) DO XCOPY /s/d/y "%%G" "C:\test123" |
|