;
break on
call @ScriptDir +"\dirlist.udf"
call @ScriptDir +"\dirplus.udf"
;call @ScriptDir +"\copyfiles2.udf"
call @ScriptDir +"\msg.udf"
call @ScriptDir +"\copyfiles.udf"
; Get the source & dest args specified on the command-line
; get the command line as an array - elements 0 & 1 are the kix.exe and the script.kix items
$aCmdLine = GetCommandLine(1)
; scan the array looking for the source arg
$ = AScan($aCmdLine, '--s:', , , 1) ; get SOURCE arg
If $ > 1 ;
$Source = SubStr($aCmdLine[$], 5)
Else ; arg is required - die if not provided
'ERROR: Source was not specified!' @CRLF @CRLF
'Usage: myscript.kix --s:Source_path --d:destination_path' @CRLF
Quit 1
EndIf
; scan the array looking for the destination arg
$ = AScan($aCmdLine, '--d:', , , 1) ; get destination arg
If $ > 1 ;
$Dest = SubStr($aCmdLine[$], 5)
Else ; arg is required - die if not provided
'ERROR: Destination was not specified!' @CRLF @CRLF
'Usage: myscript.kix --s:Source_path --d:destination_path' @CRLF
Quit 1
EndIf
$destdirs = Dir($dest + "\*")
? "Destination list is " + $destdirs
While $destdirs <> "" and @Error = 0
? "The next directory is " + $destdirs
;$copycentral = CopyFiles2($Source,$Dest + "\" + $destdirs)
$copycentral = CopyFiles($Source,$Dest + "\" + $destdirs,0,1)
$destdirs = Dir ()
Loop
exit