kpu Posted September 18, 2004 Share Posted September 18, 2004 I know there are a bunch of progress bar examples, but I'm just not understanding it.. What I would like to do is copy a users favorites to a network drive with a progress bar. This is all I have. ------------------------------------------------------------------------------------------- $copy = MsgBox(324,"Favorites", "Would you like to copy your Favorites?", "") if $copy = 7 then MsgBox(016,"Warning!", "Favorites were not Copied!", "") exit else DirCopy(@FavoritesDir, "C:\Backup\Favorites", "") if @error = 0 then MsgBox(064,"Done", "Favorites Copied", "") else MsgBox(016,"Done", "Favorites were not Copied", "") EndIf Endif exit ------------------------------------------------------------------------------------------- I would guess you would need to use $size = FileGetSize() or maby use the "DriveSpaceFree( ) I do a little VB, but I've never understood how this is done, nor can I find material that I can comprehend. Im sure this isnt that hard, I just dont have the basics. Any help would greatly be appreciated! Thanks http://www.kpunderground.com Link to comment Share on other sites More sharing options...
Somerset Posted September 18, 2004 Share Posted September 18, 2004 you need FileFindFirstFile to get the name of the files you also can create a number counter to count how many files. then plug that variable into ProgressSet... and you have to stop using copydir, that will bypass the entire progress thingy... $search = FileFindFirstFile(@FavoritesDir &"\*.url") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search) Link to comment Share on other sites More sharing options...
trids Posted September 18, 2004 Share Posted September 18, 2004 You need an opportunity to update the progress bar: DirCopy doesn't give you that opportunity cos it's just a single command (unless you want to write a tandem script that monitors the directory and IT updates a progress bar? )Here's an example of how the progress bar is updated each cycle in a loop: #26945HTH Link to comment Share on other sites More sharing options...
kpu Posted September 20, 2004 Author Share Posted September 20, 2004 Thanks for all your help! I'll let you know how I come out. http://www.kpunderground.com 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