Sign in to follow this  
Followers 0
aeldan

create copy prgress

2 posts in this topic

Hi i'm new in this forum and i have little question.

i tried to do dircopy and show a progress bar while the copy running and stuck with a problrm until the dircopy finish the script not continue running. this is the code i write:

ProgressOn("Copy BMC Image Files", "Installation complete", "0%")

dircopy ("C:\Techsup", "c:\test", 0)

do

$sourcesize = round(dirgetsize("C:\Techsup")/1024/1024)

$destinationsize = round(dirgetsize("c:\test")/1024/1024)

$dirpercentsize = $destinationsize/$sourcesize*100

ProgressSet($dirpercentsize,$dirpercentsize & "%")

until $dirpercentsize = 100

ProgressSet($dirpercentsize, "Done", "Complete")

sleep(500)

ProgressOff()

anyone have any idea how can i fix it?

Share this post


Link to post
Share on other sites



Welcome to the forums.

Since AutoIt is not multithreaded, it processes commands one after another. You may use alternate approaches to simulate DirCopy behaviour:

1. Use FileCopy() (use function recursively for sub directories) and update the progress bar based on the no. of files to copy and no. of files copied.

2. Use above approach but update the progress bar based on the no. of bytes copied and no. of bytes left to copy.

3. Use the Windows Dir Copy progress dialog (through API DllCall)

For a discussion of all these approaches, refer to this topic:

http://www.autoitscript.com/forum/index.php?showtopic=15812

Regards,

Tonedeaf

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0