Need to have batch file create a report after executing xcopy

Posted on 2006-05-10
Last Modified: 2012-08-14
I have a batch file that updates destination folders using xcopy.  I need to insert a command that will generate a text file report with any files that it had to copy to the destinations.  I am working with multiple destinations within the batch.
Question by:murryc
    LVL 7

    Accepted Solution

    read the following

    To update files in the \Reports directory with the files in the \Rawdata directory that have changed since December 29, 1993, type:

    xcopy \rawdata \reports /d:12-29-1993

    To update all the files that exist in \Reports in the previous example, regardless of date, type:

    xcopy \rawdata \reports /u

    To obtain a list of the files to be copied by the previous command (that is, without actually copying the files), type:

    xcopy \rawdata \reports /d:12-29-1993 /l > xcopy.out

    The file Xcopy.out lists every file that is to be copied.

    LVL 16

    Assisted Solution

    Then, at the end of the above add:

    copy xcopy.out lpt1:
    LVL 7

    Expert Comment

    yeah, the code provided just gives a report of files TO BE COPIED, it doesn't copy files.

    glenns code does the real copy.

    Author Comment

    What I actually needed was just the command '>>reportfile.txt' after each xcopy command.  This creates the file reportfile inside of the root folder where the batch file is executed and it displays all of the files that had to be copied.

    Thanks for all the efforts.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now