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

Author Topic: XCopy moves no files but debug claims it did  (Read 4863 times)

0 Members and 1 Guest are viewing this topic.

LemonStream

    Topic Starter


    Newbie

    • Experience: Experienced
    • OS: Windows 7
    XCopy moves no files but debug claims it did
    « on: January 04, 2013, 10:59:32 AM »
    Greetings,

    Long time reader, the site and forums has tons of info. Thanks for everything you have all contributed.

    Below is a script I wrote to make a backup of a networked location onto my local. The script creates a file for today in a location, and then uses that dynamic location to backup the files to.

    Code: [Select]
    @echo off
    set today="%date:~10,4%-%date:~4,2%-%date:~7,2%\LeadResources"
    echo %today%
    md "C:\Backups\%today%"
    pause
    xcopy "P:\XXXXX\XXXX\XXX\XXX" "C:\Backups\%today%" /L /S /I /-Y /EXCLUDE:C:\BatchF~1\Backup~1\LeadBa~1\BackupExclude.txt >> "C:\Batch Files\Temp\BackupResults.txt"
    goto :end

    The script successfully creates the dated folder and the nested LeadResources folder from the md command, but the xcopy does not move anything over.

    Looking at the BackupResults.txt file shows lines such as this:

    Code: [Select]
    ...
    P:\XXXXX\XXXX\XXX\XX\ZZZZ\ZZZ.xls
    P:\XXXXX\XXXX\XXX\XX\ZZZZ\BBBxls
    298 File(s)

    This output leads me to believe that xcopy is successful in copying the files, but the files are not in the directory.

    Any help that can be provided would be very much appreciated, I'm at a loss here.

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: XCopy moves no files but debug claims it did
    « Reply #1 on: January 04, 2013, 12:26:18 PM »
    Remove the /L switch from the XCOPY. You have XCOPY running in whatif mode, which simply displays files that would be copied.

    Good luck.  8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    LemonStream

      Topic Starter


      Newbie

      • Experience: Experienced
      • OS: Windows 7
      Re: XCopy moves no files but debug claims it did
      « Reply #2 on: January 04, 2013, 12:38:09 PM »
      Well that is just plain embarrassing. I was under my own assumption that /L would just output a list as well as copy them.

      Thank you very much.