Results 1 to 5 of 5

Thread: Log For xcopy batch file

  1. #1
    Join Date
    Mar 2010
    Posts
    191

    Log For xcopy batch file

    Hello,
    I need a log file for the below script, the script contains the xcopy command, so the log file will be needed for the xcopy command.
    Code:
    start /wait /b xcopy "z:\*.id" "c:\notes\data" /d /L /y >> "C:\Documents and Settings\Administrator\Desktop\ID_Log.txt"
    I have also manged to obtain the informational in the copied files which are in the log file, but the main concern is with the xcopy command log files. If you have any solutions for this then please let me know. thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    356

    Re: Log For xcopy batch file

    Hello,
    You have used the start and the wait calls in you script these are helpful on when you need to runs something in the window of the operating system. So, you do not need these call when you are performing some command line arguments that is command line programs. By using these in your script you will increase the complexity of the code. In you case please not that you code will append the xcopy command to the log file which is already existing. If you need to run the log file in a different or every time you need a different log file then you can write a script likewise, this should be simple.

  3. #3
    Join Date
    Nov 2009
    Posts
    583

    Re: Log For xcopy batch file

    Hello,
    I do think that you can handle the output of the xcopy command directly into a log file. There must be some other way to do this. But I am no a good programmer writing the batch files. If you need the logic then I can give you some idea about it first you have to create the log file and then add a start time for the fol file and finally run the xcopy command. At the end you will need to stop the time which you have started at the beginning.

  4. #4
    Join Date
    Nov 2009
    Posts
    446

    Re: Log For xcopy batch file

    Hello,
    For the start time and the end time you can use something like this
    Follow this script, it can help you
    Code:
    ::== timer.bat
    @echo off
    set start=%TIME%
    call YOUR.BAT
    echo %START%
    echo %TIME%
    If you have any issues related to this topic then please let me know, i will try to solve it.

  5. #5
    Join Date
    Nov 2009
    Posts
    356

    Re: Log For xcopy batch file

    Hello,
    If you need to show two timers on the screen, then you can use something like this, the above script is been modified to get a more advanced result.
    Code:
    ::== timer2.bat
    @echo off
    set start=%TIME%
    call sample.BAT
    echo started at %START%>lgfile
    echo done at %TIME%>>lgfile
    :: DONE

Similar Threads

  1. Windows Batch file to output directory names and size to txt file
    By m2thearkus in forum Software Development
    Replies: 6
    Last Post: 16-07-2010, 12:04 AM
  2. XCOPY command in bat file doesn't run as scheduled task
    By Laurense in forum Operating Systems
    Replies: 4
    Last Post: 29-03-2010, 06:02 PM
  3. XCOPY Exclude issue while copying file
    By teenQ in forum Windows Software
    Replies: 5
    Last Post: 08-02-2010, 12:01 PM
  4. How to use XCOPY to duplicate file?
    By gazwsx in forum Operating Systems
    Replies: 3
    Last Post: 19-08-2009, 07:53 PM
  5. Batch file Xcopy without manual F
    By Stockholm in forum Operating Systems
    Replies: 1
    Last Post: 13-01-2009, 09:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,435,586.35219 seconds with 16 queries