ca143508 Posted April 19, 2006 Share Posted April 19, 2006 Guys, Is there a way you can use DirCopy and have a progress bar constantly updating it's percentage value based on a calculation? ie/ $Copied = source directory size - destination directory size $Percent = $Copied / Source Directory Size Cheers, Mike Link to comment Share on other sites More sharing options...
herewasplato Posted April 19, 2006 Share Posted April 19, 2006 I have not tested this script:http://www.autoitscript.com/forum/index.ph...showtopic=11313not sure what the "update" is like. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
ELP22 Posted April 19, 2006 Share Posted April 19, 2006 .... #include <GuiConstants.au3> $path= @DesktopDir & "\cpp++\" $folder= @ProgramFilesDir & "\cp++\" $m= " size " & FileGetSize($path) ProgressOn("copy", "mm", "Progress") sleep(2000) DirCopy($folder, $path & $folder) ProgressSet(10, "mm", "mm "&$m) FileCopy(@ProgramFilesDir & "\blah3.exe", $path & "\blah3.exe") ProgressSet(30, "mm", "mm "&$m) FileCopy(@ProgramFilesDir & "\blah.dll", $path & "\blah.dll") ProgressSet(40, "mm", "mm "&$m) FileCopy(@ProgramFilesDir & "\blah.cpp", $path & "\blah.cpp") ProgressSet(50, "mm", "mm "&$m) FileCopy(@ProgramFilesDir & "\crypt.c", $path & "\crypt.c") ProgressSet(60, "mm", "mm "&$m) FileCopy(@ProgramFilesDir &"\stump.h", $path & "\stump.h") ProgressSet(70, "mm", "mm "&$m) FileCopy(@ProgramFilesDir &"\stump2.h", $path & "\stump2.h") ProgressSet(90, "mm", "mm "&$m) FileCopy(@ProgramFilesDir & "\main.dev", $path & "\main.dev") sleep(1000) ProgressSet(100, "Done", "mm Complete") sleep(1000) ProgressOff() msgbox(0,'fin','copy done') Exit Link to comment Share on other sites More sharing options...
ca143508 Posted April 19, 2006 Author Share Posted April 19, 2006 Thanks for the fast reply guys. ELP22, I had something similar to this originally but was looking for a more dynamic progress bar that showed gradule increase based on the amount of data being copied. Thanks for the help though. Greatly appreciated. Link to comment Share on other sites More sharing options...
herewasplato Posted April 19, 2006 Share Posted April 19, 2006 (edited) Greatly appreciated.You are welcome...I would say "Welcome to the forums", but with date Joined: 16-December 04???...it must be that great help file that has kept you from having to ask for help before now :-)Edit: Welcome anyway :-) Edited April 19, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
ca143508 Posted April 19, 2006 Author Share Posted April 19, 2006 I've been .... The helpfile has gotten me a fair way through things I have needed to do until now. The guys on here are brilliant. I look forward to seeing some more of their work. Link to comment Share on other sites More sharing options...
neogia Posted April 19, 2006 Share Posted April 19, 2006 (edited) This should handle what you need:MsgBox(0,"", _GetFolderSize("C:\WINDOWS", "mb")) Func _GetFolderSize($dir, $units = "b") $obj = ObjCreate("Scripting.FileSystemObject") If @error == 0 Then $folder = $obj.GetFolder($dir) Select Case $units == "b" Return $folder.Size Case $units == "kb" Return $folder.Size/1024 Case $units == "mb" Return $folder.Size/1024/1024 Case $units == "gb" Return $folder.Size/1024/1024/1024 Case $units == "tb" Return $folder.Size/1024/1024/1024/1024 EndSelect Else MsgBox(0,"","An error occurred, check that " & $dir & " exists.") EndIf EndFuncEdit: Changed error to be more informative Edited April 19, 2006 by neogia [u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia 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