Solved

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

Posted on 2008-10-20
16
355 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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
 

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 63

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 63

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

691 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