Solved

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

Posted on 2008-10-20
16
354 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
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!

 

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

732 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