My script below checks the status of a file creation and reports the size every few seconds. The file is named bxxxsr01.0, however my application creates a second and maybe third file if the file exceeds 2gb. I need to get my script to loop until all the bxxxxsr01.x have been reported on and also add the size of bxxxsr01.0 to bxxxsr01.1 and so on as they are created.
'Set Explorer Objects
Set objExplorer = CreateObject("InternetExplorer.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 400
objExplorer.Height = 200
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
objExplorer.resizable =0
do While (objExplorer.Busy)
Loop
Set objDocument = objExplorer.Document
objDocument.Open
objDocument.WriteLn "<html><head><title>LREP Data Replication</title></head>"
objDocument.WriteLn "<body bgcolor='white'>"
objDocument.WriteLn "Replicating Data to USB Device. Please Wait....<p>"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("b" + (branchid) + "sr01.0")
FileSize1 = (objFile.Size)/1024
wscript.sleep 10000
FileSize2 = (objFile.Size)/1024
'Launch Progress screen
Do Until FileSize1 = FileSize2
wscript.sleep 3000
objDocument.WriteLn("File Size so far =" & (objFile.Size)/1024 & " kb <br>")
objDocument.Close
objDocument.Open
objDocument.WriteLn "<html><head><title>LREP Data Replication</title></head>"
objDocument.WriteLn "<body bgcolor='white'>"
objDocument.WriteLn "Replicating Data to USB Device. Please Wait....<p>"
FileSize1 = (objFile.Size)
objDocument.WriteLn("File Size so far =" & (objFile.Size)/1024 & " Kb <br>")
wscript.sleep 3000
FileSize2 = (objFile.Size)
objDocument.Close
Loop
'Set Explorer Objects
Set objExplorer = CreateObject("InternetExplorer.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Width = 400
objExplorer.Height = 200
objExplorer.Left = 0
objExplorer.Top = 0
objExplorer.Visible = 1
objExplorer.resizable =0
do While (objExplorer.Busy)
Loop
Set objDocument = objExplorer.Document
objDocument.Open
objDocument.WriteLn "<html><head><title>LREP Data Replication</title></head>"
objDocument.WriteLn "<body bgcolor='white'>"
objDocument.WriteLn "Replicating Data to USB Device. Please Wait....<p>"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("b" + (branchid) + "sr01.0")
FileSize1 = (objFile.Size)/1024
wscript.sleep 10000
FileSize2 = (objFile.Size)/1024
'Launch Progress screen
Do Until FileSize1 = FileSize2
wscript.sleep 3000
objDocument.WriteLn("File Size so far =" & (objFile.Size)/1024 & " kb <br>")
objDocument.Close
objDocument.Open
objDocument.WriteLn "<html><head><title>LREP Data Replication</title></head>"
objDocument.WriteLn "<body bgcolor='white'>"
objDocument.WriteLn "Replicating Data to USB Device. Please Wait....<p>"
FileSize1 = (objFile.Size)
objDocument.WriteLn("File Size so far =" & (objFile.Size)/1024 & " Kb <br>")
wscript.sleep 3000
FileSize2 = (objFile.Size)
objDocument.Close
Loop