DevilChris Posted October 14, 2014 Share Posted October 14, 2014 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 More sharing options...
Spider001 Posted October 14, 2014 Share Posted October 14, 2014 (edited) try to use ' first then you have no problem with ' " ' $strRunXcopy = ' xcopy.exe '"' & $strSearch & '"' & '"' & $SavePath _ & $CopyPath[$ArrayItem] & '"' & ' /y /s /h /i /c /k' Edited October 14, 2014 by Spider001 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now