Sign in to follow this  
Followers 0
Gene

Code To Copy Up To 4 Files At A Time

7 posts in this topic

In the code below:

$aRootPath[$i] = The root path of up to 20 folders (in different hierarchies) to be copied.

$sRemotePath = The root path of the destination folder.

_UpdatePercentDone() puts a SplashText on the screen.

This code is in the "Differential" section of the Win9x code.

I'm using this method because Xcopy couldn't create the full destination path.

My first thought for efficiency was to put the BAT file creation in a UDF, but I wanted to make it all as tight as reasonable before I did that.

Case @OSTYPE = "WIN32_WINDOWS"
  ;$iFilesCopied = 0
   For $i = 1 To $aRootPath[0]
    _UpdatePercentDone("The backup is running... " & $aRootPath[$i])
    
    $fHandle = FileOpen(@ScriptDir & "\Diff.Bat"
    FileChangeDir($aRootPath[$i])
    FileWriteLine ( $fHandle, "Dir /b /s /A:a >" & @ScriptDir & "DiffFile.Lst" )
    FileWriteLine ( $fHandle, "Del " & @ScriptDir & "\Diff.Bat" )
    FileClose($fHandle)
    RunWait((@ComSpec & " /c " & @ScriptDir & "\Diff.Bat", "" , @SW_HIDE)
    While FileExists(@ScriptDir & "\Diff.Bat")
     FileDelete(@ScriptDir & "\Diff.Bat")
    WEnd
    _FileReadToArray(@ScriptDir & "DiffFile.Lst", $aFileArray)
    For $J = 1 To $aFileArray[0]
     Select
      Case FileExists ( @ScriptDir & "FC1.BAT" ) = 0
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       $fHandle1 = FileOpen(@ScriptDir & "FC1.BAT" )
       FileWriteLine ( $fHandle1, "Copy /b /v " & "'" & $aFileArray[$J] & " '" )
       FileWriteLine ( $fHandle1, "del " & @ScriptDir & "FC1.BAT" )
       FileClose($fHandle1)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "FC1.BAT", "",@SW_HIDE)
       
      Case FileExists ( @ScriptDir & "FC2.BAT" ) = 0
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       $fHandle2 = FileOpen(@ScriptDir & "FC2.BAT" )
       FileWriteLine ( $fHandle2, "Copy /b /v " & "'" & $aFileArray[$J] & " '" )
       FileWriteLine ( $fHandle2, "del " & @ScriptDir & "FC2.BAT" )
       FileClose($fHandle2)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "FC2.BAT", "",@SW_HIDE)
       
      Case FileExists ( @ScriptDir & "FC3.BAT" ) = 0
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       $fHandle3 = FileOpen(@ScriptDir & "FC3.BAT" )
       FileWriteLine ( $fHandle3, "Copy /b /v " & "'" & $aFileArray[$J] & " '" )
       FileWriteLine ( $fHandle3, "del " & @ScriptDir & "FC3.BAT" )
       FileClose($fHandle3)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "FC3.BAT", "",@SW_HIDE)
       
      Case FileExists ( @ScriptDir & "FC4.BAT" ) = 0
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       $fHandle4 = FileOpen(@ScriptDir & "FC4.BAT" )
       FileWriteLine ( $fHandle4, "Copy /b " & "'" & $aFileArray[$J] & " '" )
       FileWriteLine ( $fHandle4, "del " & @ScriptDir & "FC4.BAT" )
       FileClose($fHandle4)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "FC4.BAT", "",@SW_HIDE)
       
      Case Else
       While FileExists ( @ScriptDir & "FC4.BAT" ) = 1 And FileExists ( @ScriptDir & "FC3.BAT" ) = 1 And FileExists ( @ScriptDir & "FC2.BAT" ) = 1 And FileExists ( @ScriptDir & "FC1.BAT" ) = 1
        Sleep(25)
       WEnd
     EndSelect
    Next
   Next

Gene


[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites



there is a ) missing

i found a mistake, yeah :)

ok now back to the topic, what have you thought of by making it more efficient? do you want it to perform multiple copies at a time?

Thanks for pointing out the error.

Already it should copy up to 4 files at a time. By more efficient, I'm talking about tweaks to tighten the code up, make it faster, reduce the amount of code. I already plan to make a UDF to create the .BAT files. I also plan to experiment to see how many files at a time can be copied at a time without dragging down the CPU.

Gene


[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Gene

Here I revised it to include the _MakeBat(FileNo.) UDF, and a second loop trigger to make sure it doesn't loop before it is ready.

Case @OSTYPE = "WIN32_WINDOWS"
  ;$iFilesCopied = 0
   For $i = 1 To $aRootPath[0]
    _UpdatePercentDone("The backup is running... " & $aRootPath[$i])
    
    $fHandle = FileOpen(@ScriptDir & "\Diff.Bat", 2)
    FileChangeDir($aRootPath[$i])
    FileWriteLine ( $fHandle, "Dir /b /s /A:a >" & @ScriptDir & "\DiffFile.Lst" )
    FileWriteLine ( $fHandle, "Del " & @ScriptDir & "\Diff.Bat" )
    FileClose($fHandle)
    RunWait(@ComSpec & " /c " & @ScriptDir & "\Diff.Bat", "" , @SW_HIDE)
    While FileExists(@ScriptDir & "\Diff.Bat")
     FileDelete(@ScriptDir & "\Diff.Bat")
    WEnd
    _FileReadToArray(@ScriptDir & "DiffFile.Lst", $aFileArray)
    For $J = 1 To $aFileArray[0]
     Select
      Case FileExists ( @ScriptDir & "\FC1.BAT" ) = 0
       $iFc1 = 1
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) ) Then
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf
       _MakeBat(1)
      ;$fHandle1 = FileOpen(@ScriptDir & "FC1.BAT" )
      ;FileWriteLine ( $fHandle1, "Copy /b /v " & "'" & $aFileArray[$J] & " '" )
      ;FileWriteLine ( $fHandle1, "del " & @ScriptDir & "FC1.BAT" )
      ;FileClose($fHandle1)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "\FC1.BAT", "",@SW_HIDE)
       $iFc1 = 0
       
      Case FileExists ( @ScriptDir & "\FC2.BAT" ) = 0
       $iFc2 = 1
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) ) Then
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       _MakeBat(2)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "\FC2.BAT", "",@SW_HIDE)
       $iFc2 = 0
       
      Case FileExists ( @ScriptDir & "\FC3.BAT" ) = 0
       $iFc3 = 1
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) ) Then
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       _MakeBat(3)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "\FC3.BAT", "",@SW_HIDE)
       $iFc3 = 0
       
      Case FileExists ( @ScriptDir & "\FC4.BAT" ) = 0
       $iFc4 = 1
       If Not FileExists ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) ) Then
        DirCreate ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       EndIf 
       _MakeBat(4)
       FileChangeDir ( $sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2) )
       Run(@ComSpec & " /c " & @ScriptDir & "\FC4.BAT", "",@SW_HIDE)
       $iFc4 = 0
       
      Case Else
       While (FileExists ( @ScriptDir & "FC4.BAT" ) = 1 And FileExists ( @ScriptDir & "FC3.BAT" ) = 1 And FileExists ( @ScriptDir & "FC2.BAT" ) = 1 And FileExists ( @ScriptDir & "FC1.BAT" ) = 1) Or ($iFc1+$iFc2+$iFc3+$iFc4 = 4)
        Sleep(25)
       WEnd
     EndSelect
    Next
   Next

Func _MakeBat($iK) 
 $fHandle2 = FileOpen(@ScriptDir & "\FC" & $iK & ".BAT", 2 )
 FileWriteLine ( $fHandle & $iK, "Copy /b /v " & "'" & $aFileArray[$J] & " '" )
 FileWriteLine ( $fHandle & $iK, " rem del " & @ScriptDir & "\FC" & $iK & ".BAT" )
 FileClose($fHandle2)
EndFunc

Gene

Edited typos

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

Thanks for pointing out the error.

Already it should copy up to 4 files at a time. By more efficient, I'm talking about tweaks to tighten the code up, make it faster, reduce the amount of code. I already plan to make a UDF to create the .BAT files. I also plan to experiment to see how many files at a time can be copied at a time without dragging down the CPU.

Gene

Problem with copying 4 files at same time isn't that much dependant on CPU. I would say it's more dependant on HDD and from my experience copying 2 files at same time is always slower then copying 1 by 1 .. If you put 4 files at same time it also will be slower.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Problem with copying 4 files at same time isn't that much dependant on CPU. I would say it's more dependant on HDD and from my experience copying 2 files at same time is always slower then copying 1 by 1 .. If you put 4 files at same time it also will be slower.

You make a good point, as a part of the experimentation I'll do timings of a given group of files individually, 2 at a time, 3 at a time and 4 or more at a time. The reason I'm trying to do multiple files is that unlike Xcopy which Opens, Reads to the limit of RAM, then Writes & closes the file data in RAM, the copy command Opens, Reads, Writes, and Closes each file. By overlapping the Openings and Reading I hope to make better use of the cache. By overlapping the Writings and Closings I hope to avoid any dead time when nothing is happening. I'll actually do whatever is indicated by the timings.

Gene


[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Here it is with timing code in it.

Case @OSTYPE = "WIN32_WINDOWS"
 ;$iFilesCopied = 0
   For $i = 1 To $aRootPath[0]
    _UpdatePercentDone("The backup is running... " & $aRootPath[$i])
    
    $fHandle = FileOpen(@ScriptDir & "\Diff.Bat", 2)
    FileChangeDir($aRootPath[$i])
    FileWriteLine($fHandle, "Dir /b /s /A:a >" & @ScriptDir & "\DiffFile.Lst")
    FileWriteLine($fHandle, "Del " & @ScriptDir & "\Diff.Bat")
    FileClose($fHandle)
    RunWait(@ComSpec & " /c " & @ScriptDir & "\Diff.Bat", "", @SW_HIDE)
    While FileExists(@ScriptDir & "\Diff.Bat")
     FileDelete(@ScriptDir & "\Diff.Bat")
    WEnd
    _FileReadToArray(@ScriptDir & "DiffFile.Lst", $aFileArray)
    $beginOverall = TimerInit()
    $fHandle4 = FileOpen(@ScriptDir & "\IndFileTimes.Log", 1)
    For $j = 1 To $aFileArray[0]
     Select
      Case FileExists(@ScriptDir & "\FC1.BAT") = 0
       $beginFc1 = TimerInit()
       $iFc1 = 1
       If Not FileExists($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2)) Then
        DirCreate($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       EndIf
       $sCurrFile1 = $aFileArray[$j]
       _MakeBat(1)
     ;$fHandle1 = FileOpen(@ScriptDir & "FC1.BAT" )
     ;FileWriteLine ( $fHandle1, "Copy /b /v " & "'" & $aFileArray[$J] & " '" )
     ;FileWriteLine ( $fHandle1, "del " & @ScriptDir & "FC1.BAT" )
     ;FileClose($fHandle1)
       FileChangeDir($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       Run(@ComSpec & " /c " & @ScriptDir & "\FC1.BAT", "", @SW_HIDE)
       $iFc1 = 0
       $difFc1 = (TimerDiff($beginFc1)/1000)
       FileWriteLine($fHandle4, $sCurrFile1 & @TAB & " Elapsed Time = " & $difFc1 & " Seconds")
       
      Case FileExists(@ScriptDir & "\FC2.BAT") = 0
       $beginFc2 = TimerInit()
       $iFc2 = 1
       If Not FileExists($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2)) Then
        DirCreate($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       EndIf
       $sCurrFile2 = $aFileArray[$j]
       _MakeBat(2)
       FileChangeDir($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       Run(@ComSpec & " /c " & @ScriptDir & "\FC2.BAT", "", @SW_HIDE)
       $iFc2 = 0
       $difFc2 = (TimerDiff($beginFc2)/1000)
       FileWriteLine($fHandle4, $sCurrFile2 & @TAB & " Elapsed Time = " & $difFc2 & " Seconds")
       
      Case FileExists(@ScriptDir & "\FC3.BAT") = 0
       $beginFc3 = TimerInit()
       $iFc3 = 1
       If Not FileExists($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2)) Then
        DirCreate($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       EndIf
       $sCurrFile3 = $aFileArray[$j]
       _MakeBat(3)
       FileChangeDir($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       Run(@ComSpec & " /c " & @ScriptDir & "\FC3.BAT", "", @SW_HIDE)
       $iFc3 = 0
       $difFc3 = (TimerDiff($beginFc3)/1000)
       FileWriteLine($fHandle4, $sCurrFile3 & @TAB & " Elapsed Time = " & $difFc3 & " Seconds")
       
      Case FileExists(@ScriptDir & "\FC4.BAT") = 0
       $beginFc4 = TimerInit()
       $iFc4 = 1
       If Not FileExists($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2)) Then
        DirCreate($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       EndIf
       $sCurrFile4 = $aFileArray[$j]
       _MakeBat(4)
       FileChangeDir($sRemotePath & "\" & @UserName & "_" & @YEAR & "-" & $sMon & "-" & StringRight("0" & @MDAY, 2) & "-" & $sWkDay & "-" & $sHour & "Hr" & "-" & $sMin & "Min" & StringTrimLeft($aRootPath[$i], 2))
       Run(@ComSpec & " /c " & @ScriptDir & "\FC4.BAT", "", @SW_HIDE)
       $iFc4 = 0
       $difFc4 = (TimerDiff($beginFc4)/1000)
       FileWriteLine($fHandle4, $sCurrFile4 & @TAB & " Elapsed Time = " & $difFc4 & " Seconds")
       
      Case Else
       While (FileExists(@ScriptDir & "FC4.BAT") = 1 And FileExists(@ScriptDir & "FC3.BAT") = 1 And FileExists(@ScriptDir & "FC2.BAT") = 1 And FileExists(@ScriptDir & "FC1.BAT") = 1) Or ($iFc1 + $iFc2 + $iFc3 + $iFc4 = 4)
        Sleep(25)
       WEnd
     EndSelect
    Next
    FileClose($fHandle4)
    $difOverall = (TimerDiff($beginOverall)/1000)
    FileWriteLine(@ScriptDir & "\OverallTime.Log", @YEAR & "-" & @MON & "-" & @MDAY & " - " & @HOUR & ":" & @MIN & ":" & @SEC & " Elapsed Time = " & @TAB & $difOverall & @TAB & " Seconds")
    FileWriteLine($fHandle4, @YEAR & "-" & @MON & "-" & @MDAY & " - " & @HOUR & ":" & @MIN & ":" & @SEC & " Elapsed Time = " & @TAB & $difOverall & @TAB & " Seconds")
    FileClose($fHandle4)
   Next

Gene

Edited by Gene

[font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...

Share this post


Link to post
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
Sign in to follow this  
Followers 0