Link to home
Start Free TrialLog in
Avatar of CanvasYou
CanvasYou

asked on

Can I copy files (using the copy dialog) from one folder to another but...?

...but I want to copy all the files in a folder from one folder to another - and it will only copy files w/ a newer lastWriteTime - and never promt the user - but it will show the copy dialog.

If
sfile.LastWriteTime > File.GetLastWriteTime(dest & sFile.Name) Then
sFile.CopyTo (Dest & sfile.name, true)


Something like that - but using the copy dialog show -
basically I want to copy from one folder to another - all the files
and I want it to show the progress -
and I want it to run on a thread of its own
Because I am running 4 folder copy subs at the same time.


When ever I use the file copy dialog - I get prompts - asking me if I want to overwrite YES YES to ALL and NO - something like that...
Any suggestions?
I posted earlier trying to make my own progress bars on the form -
but I am getting all kinds of errors trying to update objects on the form - because I am using threading to call the file copy.

Help - Please! haha
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Why don't you make your own progress form ? You just need to count the total of items and increment the progress bar on each one.
This way you can chek the dates/time and do the actions you want.
Avatar of CanvasYou
CanvasYou

ASKER

You mean a progress form for each one?
I still would have a thread running - and have to call to update the objects - which are existing outside the thread - so it won't work...
well I can't get it to work - anyway.. haha - i have been playing w/ this for a few days now!
I am lost.
If you have any ideas I would appreciate it
>> You mean a progress form for each one?
Of course not! If you want to copy 10 files you create a new form with a progress bar on it and for each file copied you perform a step on the progress bar. Ok, if you have 1 huge file and 9 smaller you will not have a nice progress bar but you also don't have that on windows explorer (most of the times).
The problem is "and it will only copy files w/ a newer lastWriteTime" because the rest can be done.
That's why I have suggested that.
"The problem is "and it will only copy files w/ a newer lastWriteTime" because the rest can be done."
I'm sorry - Can you explain more.. If you have the time.. thanks.
Let me do some tests and I show you some code snippet and solutions
I appreciate it.
The problem is - It has to run each file copy group on a new thread - and update the main form's progress bar.
https://www.experts-exchange.com/questions/23829699/Another-Cross-Threading-update-object-question.html
Please see what I am trying to do - anyone?
Help!
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks -
Is there a reason why this solution is only worth a "B"?
Because you pointed me to another post - that is not really specific to what I was looking for - it will work - but it was not the exact thing..
I appreciate it though - don't take it the wrong way!
You solved it on the other post - but I was kinda asking 2 differnt things.
One was creating a custom progress bar - this one was to try to use the built in copy dialog.
and have it run copying only newer files - and update progress - using all windows built-in copy dialog w/o prompting...
does that make sense?
I am a beginner at VB.net - that is obvious! I appreciate your help though - really.