Sign in to follow this  
Followers 0

Display A Progress Bar During File Copying...

1 post in this topic


I've written a script to copy data DVDs to a hard drive (into certain folders depending on the label, etc) but I would appreciate your help with displaying and updating a progress bar to show progress while copying the files. Here is some code I wrote to attempt to do this:

;Turn progress bar on.

ProgressOn("Working...", "Copying Files...", "0 percent", -1, -1, 19)

;Get the current size of the target DVD in MB.

_RunDOS("Dir /s /-c d:\ > dir.txt")

$dir=FileOpen ("dir.txt", 0)

$bytes=FileReadLine($dir, _FileCountLines("dir.txt") - 1)



$folderSize=Round($folderSize / 1048576)

$per=Round($folderSize / $size * 100)

;Enable Adlib to update the progress bar while copying files.


;Start copying files using 'xcopy' to copy only the files that don't exist on target.

_RunDos("Xcopy /y /f /d /s /e D:\ " & $target) ;The target folder will vary.

Func progBar()


$growth=Round($free - $freeNow)

$folderSize=$folderSize + $growth

$per=Round($folderSize / $size * 100)

$foldersize=$folderSize - $growth

If $per > 0 Then ProgressSet($per, $per & " percent")


The above code does work to at least some extent but I'd like any suggestions or better ways to do the same thing.

Thank you very much.


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