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
Solved

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

Posted on 2008-10-20
16
353 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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