VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Hi cats,

    please I have a xdcam drive unit that can have a variable number of file based on the disc inserted. So for example I can have:

    C0001.MXF
    C0002.MXF
    C0003.MXF
    ...
    C0100.MXF

    and so on.

    I would like do a batch that copy all mxf files in the current directory but:

    during the copy, and for each mxf, it have to copy the file as a temporary file with extension .tmp. ONLY when the copy is finisched --> rename it as the original.

    For example: during the copy of C0001.MXF it have to write (in the current directory) C0001.TMP

    and only when the the copy is finisched -->rename C0001.TMP as C0001.MXF

    and so on.

    How can I do? thanks
    Quote Quote  
  2. xcopy *.mxf *.tmp
    ren *.tmp *.mxf
    Quote Quote  
  3. why do you have to name it tmp in the process?
    Quote Quote  
  4. Do you have to use xcopy? What about copy in a for loop?

    Code:
    for %%f in ("D:\temp\folder 1\*.MXF") do (
        copy "%%f" "D:\temp\folder 2\%%~nf.TMP"
        ren "%%~dpnf.TMP" "%%~dpnf.MXF" )
    Quote Quote  
  5. Originally Posted by jagabo View Post
    Do you have to use xcopy? What about copy in a for loop?

    Code:
    for %%f in ("D:\temp\folder 1\*.MXF") do (
        copy "%%f" "D:\temp\folder 2\%%~nf.TMP"
        ren "%%~dpnf.TMP" "%%~dpnf.MXF" )
    XCOPY cat
    a loop? exactly I don't know
    Quote Quote  
  6. oh no sorry is enouth copy
    Quote Quote  
  7. Originally Posted by teodz1984 View Post
    why do you have to name it tmp in the process?
    to prevent corrupted destination .mxf video file if during the copy process ends prematurely in case of error, disconnection of the drive, or power failure, or other reasons that interrupt the copy
    Quote Quote  
  8. however it works thanks
    Quote Quote  
  9. xcopy has been deprecated in favor of robocopy. YW
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!