Jump to content

Help~ Converting xcopy to robocopy


Recommended Posts

Hi,

I have tried converting xcopy func from part of a script to robocopy, it works but the parameter is placed wrong inside the " which i have no idea where to slove the error. Any kind soul can help to troubleshoot?

 

Original Code

Func _CopyFiles(ByRef $strSearch, ByRef $ArrayItem)
    Local $strRunXcopy
    $strRunXcopy = " xcopy.exe """ & $strSearch & """ """ & $SavePath _
             & $CopyPath[$ArrayItem] & """ /y /s /h /i /c /k"
    If $LogFlag = 1 Then
        $strRunXcopy &= " >>" & Chr(34) & $LogPath & $LogType & Chr(34) & " 2>&1"
    EndIf
    RunWait(@ComSpec & " /c title " & $CopyPath[$ArrayItem] & "|" & $strRunXcopy, "", @SW_HIDE)
EndFunc   ;==>_CopyFiles

Converted by me

Func _CopyFiles(ByRef $strSearch, ByRef $ArrayItem)
    Local $strRunXcopy
    $strRunXcopy = " Robocopy.exe """ & $strSearch & """ """ & $SavePath _
             & $CopyPath[$ArrayItem] & """/s /copy:DAT /256 /xd /ts /eta"
    If $LogFlag = 1 Then
        $strRunXcopy &= " >>" & Chr(34) & $LogPath & $LogType & Chr(34) & " 2>&1"
    EndIf
    RunWait(@ComSpec & " /c title " & $CopyPath[$ArrayItem] & "|" & $strRunXcopy, "", @SW_HIDE)
EndFunc   ;==>_CopyFiles

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...