Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: XCOPY matching data to same drive (loopback) issue  (Read 3056 times)

0 Members and 1 Guest are viewing this topic.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
XCOPY matching data to same drive (loopback) issue
« on: November 06, 2008, 01:46:20 AM »


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)?


fireballs



    Apprentice

  • Code:Terminal
  • Thanked: 3
    Re: XCOPY matching data to same drive (loopback) issue
    « Reply #1 on: November 06, 2008, 02:32:09 AM »
    use
    Code: [Select]
    for /r
    FB
    Next time google it.

    DaveLembke

      Topic Starter


      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: XCOPY matching data to same drive (loopback) issue
    « Reply #2 on: November 07, 2008, 11:30:35 AM »
    Thanks 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"