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

Author Topic: xcopy and print log file help?  (Read 4770 times)

0 Members and 1 Guest are viewing this topic.

migasmike

  • Guest
xcopy and print log file help?
« on: April 10, 2006, 03:56:08 AM »
Hi,

I have this batch files created xcopy d:\backupl g:\backup /e /c /i /f /h /d /y in Windows XP.
The drive letter d: is the partition d: and the drive letter g: is a Firewire external HDD.

I donīt know hi, but in the last week the batch files doesnīt run until he is finishid, but i canīt see the error message because the windows close to quickly and i can see...

I think that is possible to put a command file in this batch to write a Log file to the HDD, and read the log file discoreved the error...?

I donīt know how to do it :-[

Someone can help me please.

Thanks,

MigasMike

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: xcopy and print log file help?
« Reply #1 on: April 10, 2006, 05:08:13 AM »
xcopy issues error codes that can be checked by a batch file.

0  Files were copied without error.
1  No files were found to copy.
2  The user pressed CTRL+C to terminate xcopy.
4  Initialization error occurred. There is not enough memory or disk space, or you entered an invalid
    name or invalid syntax on the command line.
5 Disk write error occurred.
 
Something like this may work:

Code: [Select]
xcopy d:\backupl g:\backup /e /c /i /f /h /d /y > file.log
if errorlevel 1 notepad file.log

You may have to use pathnames for the file.log depending where you want to put the log.

Hope this helps. 8-)
« Last Edit: April 10, 2006, 05:10:13 AM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein