Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Predict FileCopy Process Time 2

Status
Not open for further replies.

Rofeu

Technical User
Apr 13, 2005
500
NL
Hello,

I've some code that copies the content of a folder into another folder. However, the size can be quite large and I'd like to give the user an estimate of how long it will take beforehand.

Now, it's easy enough to get the size of the folder via the filesystemobject, but I'm at a loss as to what to divide that with.

I could do some copying in explorer and mark down the size and time indication, but I don't think that'll be too representative.

Does anyone have any suggestions how to best go about this?

Cheers,

Roel

 



Maybe run a time test?

Although, time over a network, depends on the traffic.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
combo,

that was exactly what I was looking for and in fact it does give an estimation on time remaining. Have a star for that!

Skip,
I did some time tests, but as you say, it really depends on the network traffic. That's why said that they would not be too representative.

Cheers,

Roel
 



Merry Christmas, combo! ==> *

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
hi Rofeu

very impressed with your question and soultion gave by combo. I tried to reproduce the same. but i am not able to do same and i didnt get he the dialog. could you explain how exactly you used shell to get the time that would be taken to copy data..

Thanks Rofeu..

Sefen
 
Hi,

I think that your problem is that you assign the path of the folder to be copied to a string variable and pass that as the first parameter to the CopyHere method.

I've noticed that it passes right over it without doing anything. You need to dimension your variable as a variant for it to work. (this is not mentioned in the acticle by the way).

Cheers,

Roel
 
With early binding:
Dim objShell As Shell32.Shell
Dim objFolder As Shell32.Folder
Const FOF_CREATEPROGRESSDLG = &H0&
Set objShell = New Shell32.Shell
Set objFolder = objShell.NameSpace("TargetFolderPath")
objFolder.CopyHere "SourceFilePathAndName", FOF_CREATEPROGRESSDLG


combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top