Solved

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

Posted on 2008-10-20
16
351 Views
Last Modified: 2010-04-21
...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
0
Comment
Question by:CanvasYou
  • 9
  • 5
  • 2
16 Comments
 
LVL 48

Expert Comment

by:jpaulino
ID: 22769609
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.
0
 

Author Comment

by:CanvasYou
ID: 22769645
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
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22769676
>> 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).
0
 

Author Comment

by:CanvasYou
ID: 22769722
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22771242
The problem is "and it will only copy files w/ a newer lastWriteTime" because the rest can be done.
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22771245
That's why I have suggested that.
0
 

Author Comment

by:CanvasYou
ID: 22771282
"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.
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 22771407
Let me do some tests and I show you some code snippet and solutions
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:CanvasYou
ID: 22771425
I appreciate it.
0
 

Author Comment

by:CanvasYou
ID: 22803113
The problem is - It has to run each file copy group on a new thread - and update the main form's progress bar.
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23829699.html
Please see what I am trying to do - anyone?
Help!
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 22807359
Hi CanvasYou;

Create four BackgroundWork's one for each Group and code it something like in the last post, http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23847125.html.

Fernando
0
 

Author Closing Comment

by:CanvasYou
ID: 31508075
Thanks -
0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 22808048
Is there a reason why this solution is only worth a "B"?
0
 

Author Comment

by:CanvasYou
ID: 22808094
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!
0
 

Author Comment

by:CanvasYou
ID: 22808103
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?
0
 

Author Comment

by:CanvasYou
ID: 22808104
I am a beginner at VB.net - that is obvious! I appreciate your help though - really.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now