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

Author Topic: XCOPY Error LOG?  (Read 23455 times)

0 Members and 1 Guest are viewing this topic.

kvnsdr

  • Guest
XCOPY Error LOG?
« on: August 04, 2005, 08:48:14 AM »
I use the following XCOPY syntax to backup to an external HDD:

xcopy /h /i /c /s /e /y C:\"Documents and Settings"\*.* G:\Backup\ /d


Q. How can I create an error log?

Q. How can I log files changed / new files copied?
« Last Edit: August 04, 2005, 08:50:05 AM by kvnsdr »

Gizmo73



    Intermediate

  • We do only what we are meant to do
    Re: XCOPY Error LOG?
    « Reply #1 on: August 04, 2005, 09:29:06 AM »
    This code may work:

    set log=c:\xcopy.log
    set error=c:\xcopy.error.log
    echo %date% %time% >> %log%
    echo %date% %time% >> %error%
    xcopy "c:\mirc\*.*" c:\test\ /c/y/i/e/v/f >> %log% 2>> %error%

    [glb]Gizmo73[/glb]

    kvnsdr

    • Guest
    Re: XCOPY Error LOG?
    « Reply #2 on: August 04, 2005, 12:19:28 PM »
    It works!

    Q. What does the 2 >> mean?

    Q. Can I put another 3 >> %user% behind it?

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: XCOPY Error LOG?
    « Reply #3 on: August 04, 2005, 02:28:17 PM »
    DOS commands allocate devices for it's output. STDOUT which is used generally for informational messages that record the programs progress and STDERROR which is used for errors. By using >> %log%, you redirected the STDOUT data stream to whatever device %log% defined; by using 2>> %error% you redirected the STDERROR data stream to whatever device %error% defined.

    I am not aware of a third device, but DOS can be quirky, so you never know.;)

    Hope this helps. 8)
    « Last Edit: August 04, 2005, 02:33:34 PM by Sidewinder »
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein