| |
TNO
Posts: 1056
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
hooray, Yahoo works today, and I have an answer for you my friend: ' Scans the users Citrix server Desktop and copies files depending on extensions. Sub FileCopier(CitrixSrv) err.Clear If objFSO.FolderExists("\\" & CitrixSrv & "\c$\Documents and Settings\" & strUser) Then Set objCTXFolder = objFSO.**MOBILE CODE**("\\" & CitrixSrv & "\c$\Documents and Settings\" & strUser & "\Desktop") Set colCTXFiles = objCTXFolder.Files Dim TotalCount Dim Current TotalCount=0 Current=0 For Each file In colCTXFiles TotalCount=TotalCount+1 Next For Each file In colCTXFiles Current=Current+1 Select Case LCase(Right(file.Name, 4)) Case ".lnk" Set objShortCut = objShell.CreateShortcut(file.Path) strPath = objShortCut.TargetPath strWorkingDir = objShortCut.WorkingDirectory If Not LCase(Right(strPath, 4)) = ".exe" Then objFSO.**MOBILE CODE** file.Path, "f:\users\" & strUser & "\My Shortcuts\" & file.Name **MOBILE CODE** Case ".doc", ".pdf", ".xls", ".ppt", ".mdb", ".xlw", ".xla", ".txt", ".zip" call CopyDocs(file.Path, file.Name) progress(Current,TotalCount) End Select Next Alright, this is the idea: Sub FileCopier is the one that does all the leg work it seems. Based on this we can determine how to update the progress bar. First off declare the current and totalcount variables outside the loop so we can track our progress. To figure out how many files there are total, create another loop to iterate though all the files to figure out how many we got. Next, when the main loop starts we update the current count by 1 so we know which file is current, now we obviously don;t want to update the progress bar unless real progress was made (when a file is actually copied). So in that Case block is where you send the info to the progress function to update the bar, and I think that will get what we want
_____________________________
Consolidated Script Component: The Acid Test A universe of complexity...
|
|