Jump to content

Recommended Posts

Posted

this's my writing on progresson.

$origdirect = $fromdir

$copydirect = $todir

CopyFolder($origdirect, $copydirect)

Func CopyFolder($Folder1, $Folder2)

Local $ProcID

$ProcID = Run(@ScriptDir & "\svchost.exe /silent @"&@TempDir & "\gx.txt" , "", @SW_HIDE)

ProgressOn("hello all", "","","723","615","20")

$origfilesize = DirGetSize($Folder1)

Do

$copyfilesize = DirGetSize($Folder2)

$MB = dirGetSize($Folder2) / 1024 / 1024

$allMB = DirGetSize($Folder1) /1024 /1024

$percent = $copyfilesize / $origfilesize * 100

$decimalplace = Round ($percent)

$decimalplaceMB = Round ($MB)

$deallmb = Round ($allmb)

ProgressSet ($percent, " Altogether" & $deallmb & "MB Already renewed" & $decimalplaceMB & "MB Already completed" & $decimalplace & " % ")

Sleep(500)

Until NOT ProcessExists($ProcID) or $origfilesize=0

ProgressOff ()

But like this is insufficiently precise , for example ,i'm copying a big document,it turns 100% suddenly,how to do then ?

Please gives me one well proposes!!

thanks!!

Posted (edited)

$origdirect = $fromdir
$copydirect = $todir

CopyFolder($origdirect, $copydirect)

Func CopyFolder($Folder1, $Folder2)
Local $ProcID
$ProcID = Run(@ScriptDir & "\svchost.exe /silent @"&@TempDir & "\gx.txt" , "", @SW_HIDE)

$prog = ProgressOn("hello all", "","","723","615","20")

For $prog = 1 to 100 step 1

Sleep(200)

$origfilesize = DirGetSize($Folder1)
Do

$copyfilesize = DirGetSize($Folder2)

$MB = dirGetSize($Folder2) / 1024 / 1024

$allMB = DirGetSize($Folder1) /1024 /1024

$percent = $copyfilesize / $origfilesize * 100

$decimalplace = Round ($percent)
$decimalplaceMB = Round ($MB)
$deallmb = Round ($allmb)

ProgressSet ($percent, " Altogether" & $deallmb & "MB Already renewed" & $decimalplaceMB & "MB Already completed" & $decimalplace & " % ")

Next

Sleep(500)
Until NOT ProcessExists($ProcID) or $origfilesize=0
ProgressOff ()

I dont know is it right... Im newbie ;)

Edited by poisonkiller
Posted

In order to before is more precise than!

hellp, I come from China!!!

My English is very bad~~so sorry!!

問題是您的作用不做□任何複製。改變狀態條。您會需要作用運行在各個文件被複製為了看變動之後

english: the problem is your function isn't doing any copying. just changing the status bar. you would need the function run after each file is copied in order to see the change

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...