Task Scheduler or VBA to simple copy periodically folders contents to external drive

I need to copy periodically all files (without any other data
manipulation)
 from folders W, X, Y on Drive C to folder Z on Drive D.
Any existing files would ge ovewritten without prompting.
Is it more convenient to process this through Windows Task Scheduler
or through VBA ?

Help appreciated,

J.P.
0
u473
3/5/2010 9:52:56 PM
excel.programming 6508 articles. 2 followers. Follow

1 Replies
903 Views

Similar Articles

[PageSpeed] 50

If you need to work only with files, not subfolders, you can use code
like the following:


Sub AAA()
    Dim FromFolders As Variant
    Dim ToFolder As String
    Dim N As Long
    Dim FName As String
    FromFolders = Array("C:\Test", "C:\Test2")
    ToFolder = "D:\Z"
    Application.DisplayAlerts = False
    For N = LBound(FromFolders) To UBound(FromFolders)
        ChDrive FromFolders(N)
        ChDir FromFolders(N)
        FName = Dir("*.*", vbNormal)
        Do Until FName = vbNullString
            On Error Resume Next
            Kill ToFolder & "\" & FName
            On Error GoTo 0
            Name FName As ToFolder & "\" & FName
            FName = Dir()
        Loop
    Next N
End Sub

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
	Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com





On Fri, 5 Mar 2010 13:52:56 -0800 (PST), u473 <u473@aol.com> wrote:

>I need to copy periodically all files (without any other data
>manipulation)
> from folders W, X, Y on Drive C to folder Z on Drive D.
>Any existing files would ge ovewritten without prompting.
>Is it more convenient to process this through Windows Task Scheduler
>or through VBA ?
>
>Help appreciated,
>
>J.P.
0
Chip
3/5/2010 10:03:02 PM
Reply:

Similar Artilces:

Calendar and Tasks
Morning All, Is it possible to have the tasks show up on the calendar? Scott V No. Only beside it. you can drag a task to the calendar if you need to assign a time to it. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Search Engines (Visual QuickStart Guide) Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com Join OneNote Tips mailing list: http://www.onenote-tips.net/ "Scott Viney" <scott@kar...

How to transfer and copy files from iPod to iPod Touch
[b]How to transfer and copy files from iPod to iPod Touch by drag and drop with the iPod to iPod Touch transfer software.[/b][url=http://www.ipod-to-ipod-touch.com/copy-music-videos-playlists-from-ipod-to-ipod-touch.html][b]iPod 2 iPod[/b][/url] is the best and powerful iPod transfer capability. It can copy music/video/playlist from [b]iPod to iPod Touch[/b] by Drag and Drop. iPod 2 iPod will transfer and copy music/video/playlist from one to one at extremely fast speed. It supports [b]iPod to latest iPod Touch transfer[/b].[b]Guide: How to copy music videos playlists from ipod to ipod touch?[...

OL 2003 button: schedule automatic send/receive
Would like to add a macro to toggle automatic send/receive in the current profile. Action would be equivalent to checking/unchecking Setting for groups "All Accounts" - Schedule automatic send/receive (or perhaps toggle interval between zero, non-zero?). Thanks for any ideas. George ...

do I need to backup public folder
I'm using veritas agent and have selected both Exchange information store folder and exchange directory folder.. Do I need to select the public folder as well. I'm assuming if the above (2) folders are selected , I don't have to select the public folder..correct? -Darren exchange 5.5? if you're backing up the Information store, you're backing up the public folders (if you're doing online backups)... "Darren D" <Darren@somewhere.com> wrote in message news:OWYrjifXEHA.2500@TK2MSFTNGP09.phx.gbl... > I'm using veritas agent and have selected bot...

Public Folder Permissions?
Hi, Is there a way to secure PF's with security groups as opposed to DL's? It doesn't appear doable which is fine as I can create a few dist groups but it seems odd that security groups cannot be used. Is there some "ultra cool" technical reason why not? Thanks, Dan Hi Dan, Well I guess Exchange is really an email system and when you admin public folders from Outlook etc it seems to make sense to use mailing lists (DL's) which can also be given manager rights to managers to control. I am sure that one of the MVP's can give you a very techincal explaina...

Outlook Task Failure
Hi Whenever I try to assign a task in Outlook 2002 I get an error message: "Could not complete the operation. One or more parameters are not valid" Does anyone know how to get around this? Thanks ...... Craig *** Problem Description *** Action (A): When trying to save a task item there is an error. Result (R): Could not complete the operation, one or more parameters are not valid Cause (C): Corruption to the tasks folder. <><><><><><><><><><><><><><><><><><><><...

Help w/auto fill or copying
I receive a downloaded report and can't change the format in which I receive the report. Therefore, I have to try and get these 20,000+ lines in a format I can use easily. This is the format of the data: Column A Column B Column C, etc.... Name 1____1001_______X _____________________X _____________________S _____________________Y Name 2____1002_______X Name 3____1003_______Y _____________________Y ____________________________________ Each name can have multiple rows of data and there are about 15 columns. I need the information for each row and my first thought was to try and ...

Copying Outlook #2
How do I copy over the Outlook.NK2 file? Hi Roy, okay, you have an old Outlook.NK2 file and you wanted to move it to your current Outlook? Please r-click |copy| Delete your old *.NK2 file and paste the new one! -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etwas davon hat. Bravestar@Datenschutzministerium.de "Roy" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag news:383801c471c5$8f27c220$a501280a@phx.gbl... > How do I copy over the Outlook.NK2 file? Thank You. Just wanted to make sure. >-----Original Mess...

BadMail folder EXCH 2003
Hi, A question regarding the folder badmail on the exchange server, how do I delete this? files? Should it be done inside Exchange Administration or could one just dele them? Is there any way to limit this? /Jim IIRC E2003 SP1 will let you disable use of the badmail folder. However, you can safely delete the files - I usually do this with a batch file, scheduled to run once a day - del <full path to badmail including double quotes if there are spaces>\*.* /q JS wrote: > Hi, > A question regarding the folder badmail on the exchange > server, how do I delete this? > files...

Trouble copying video
I am having strange trouble copying and playing a video in WinXP. It's about 40 minutes long and came to me on a DVD in a few versions, all of which seem to be identical except for tremendous differences in the file size (from 20 mb to 5.2gb!) and all the files end in *.vob. There are a b unch of other strange looking files with different extensions but I have no idea what they are since I can't open them. I have no idea what that *.vob extension means but on the DVD the video files can be opened and will play with Windows Media Player. BUt when I copy the files to my...

Concatenate Tasks With Summary Tasks in Reports
I think I have found in other posts but I want to ask directly just in case someone else has other info... Can MSP concatenate each task in a report with its summary tasks? Without this, I don't know what part of the project each task pertains to. (Example, does "Buy space" pertain to the April or May set of tasks?) If I add a breadcrumb to each task in the entry view, not only is this time consuming but I also can't read the entry view as well as before. This limitation severly cuts down on the usefulness of the reports for me. In article <FFB3AE7E-881E...

Assigning XML string as the content of an attribute
Hi. I want to assign an XML string to an XML attribute. This XML string must undergo "escape" conversion so that the < and & symbols are converted in to escaped equivalents. Does the .Net library have a conversion method that does this? Note that I want to construct the resulting XML string myself without having to use an XmlDocument. E.g. string myXml = "<root><record/><record/></root>"; string myDoc = "<doc myXml='" + Converter.escapeMyXml (myXml ) + "'/>"; -- McGeeky http://mcgeeky.blogspot.com ...

CRM Task question
Hi, I have a question regarding CRM task and Outlook Task on CRM v1.2, here is the scenario: "User A uses "CRM Task" on Outlook Sales Client to create a task and assign to User B User B updates the task on Outlook only and reply (or assign) back to User A Will the updated task (from the Outlook side) be the same updated task on the CRM if we don't use Online or Offline feature?" Because what happen is my user (user A) showed me an error message stating that there is an error synchronized task (from Outlook) to CRM task. She didn't use synch...

HOWTO CPU intensive task without make GUI not responding?
How to make a CPU intensive task without make GUI not responding? For example, i want to show the user a progress animation during the intensive task, but this animation is blocked until the task has finished... Thanks On Mon, 12 Jan 2004 16:28:59 GMT, "michele" <mandelbort@oggiweb.com> wrote: >How to make a CPU intensive task without make GUI not responding? >For example, i want to show the user a progress animation during the >intensive task, >but this animation is blocked until the task has finished... >Thanks > Run the task in a low priority thread. ...

Excel 2007
If I copy some cells from Excel 2007 to notepad the values are enclosed in quotes - is it possible to disable this 'wrapping' with quotes? Thanks Andy You could use a macro. Saved from a previous post: I used the PutInClipboard routine that Chip Pearson has: http://www.cpearson.com/excel/clipboard.htm With this sub: Option Explicit Sub testme() Dim MyDataObj As DataObject Set MyDataObj = New DataObject MyDataObj.SetText ActiveCell.Text MyDataObj.PutInClipboard End Sub And then pasted (manually) into NotePad. No double quotes were inserted. But I did see a l...

Can different email addresses be delivered to different folders?
Can I have Outlook 2003 send different email address to different folders? IOW, can mail to my secondary address be delivered to some folder other than the inbox? -- Visit us at http://home.comcast.net/~lmacmil In news:e-ednS9L_c8FbGbfRVn-jA@comcast.com, Lee M. <lmacmil@forget_it.com> typed: > Can I have Outlook 2003 send different email address to > different > folders? IOW, can mail to my secondary address be delivered to > some > folder other than the inbox? You can effectively do this by creating a rule to move the mail to the folder you want when it arri...

Sharing Tasks in the 2007 versions of Project and Outlook
Hi, I would like to export and work on my Project 07 tasks in Outlook 07. I am aware of how I can export them but this does not keep the link with Project. Could anyone tell me if there is a way of doing this in Microsoft or if there is an add-in I could purchase. Thanks Caz This is a multi-part message in MIME format. ------=_NextPart_000_00D7_01CAB3DB.7FC83F40 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Caz, Welcome to this Microsoft Project newsgroup :-) You might like to see Companion Products an...

Task Scheduler error
A long time ago I scheduled a task to load up a certain utility at 7 am. However, I've just realized it never gets loaded. I went into Task Scheduler to see what's going on, and as it opened I get this error: "An error has occured for task Reminders - owner. Error message: the specified account name is not valid" I'm looking at my task and I see that "When running a task, use the following user account" is set to "RICK \owner". I'm not sure how to check if that's a valid account name. I don't log on to my computer wi...

Not incoming external mail to CRM queue
Hi, I have read the Implementation guide, and have done exactly as they have said. I have created a disabled user as per the spec and done both CRMEmailEnabled and "Associated External" on the exchange advanced in AD. I have created the queue and set the labels correctly. I am not sure what else i could be missing. I can´t receive email from external domain to CRM queue. Microsoft Exchange Server 2003 infrastructure work very good... Thank, have you installed the CRM Exchange Router? if so, are there any errors in the event viewer on the exchange server? Dave "A...

Certain mails going to bad mail folder no error other than 0x80004005
Got SBS with Exchange 2003, ISA 2004 - all updated to latest SP's. Most of our mail has started going to the bad mail folder, initially thought it was something to do with attachments, we also have GFI Mail Essentials, Mail Security and Mail Archiving installed - disabled those to no avail. Most of the mail is ending up in the bad mail folder with a BDR report with the above string in. (I had to re-enable the bad mail folder after the SP update to see what was going on - although that doesnt help). My ISP says their server is relaying everything to ours okay, they have no exchange expe...

how can I replace SQL query with VBA logic
I have a table which looks like the following.. Sample group TestNo 29045 IG Test 1 29053 IG Test 1 29053 IR Test 1 29067 IG Test 1 29067 IR Test 1 and I need to correct my TestNo, If the sample is same and group is different then I need to assign different no, My query looks like this.. DoCmd.RunSQL "UPDATE tbl_Results set TestNo='Test 2' where group='IG' and TestNo='Test 1';" this query updates every row with IG whcih is not correct. I wan to update only if the sample is same and group is different. I want to get values of FixedNo and not Error...

HHow to copy contacts/address book
Is there a facility to copy my address book from Office 2003 to 2010 The same way as before, and has allways been since outlook 2k "DAR" <DAR@discussions.microsoft.com> wrote in message news:32297F17-20E1-437C-9268-EAC168129166@microsoft.com... > Is there a facility to copy my address book from Office 2003 to 2010 Since Outlook does not have an address book you'll need to clarify what you want to do. -- Russ Valentine "DAR" <DAR@discussions.microsoft.com> wrote in message news:32297F17-20E1-437C-9268-EAC168129166@microsoft.com... ...

task pane correction
To make the task pane go away I went under Help - Microsoft Excel Help- See Also - then clicked on - Online Content Settings and unchecked- Show Template help automatically when available. -- Diane @ SPSCA ...

Updating tasks with VBA script
I've built a scheduling tool which uses Access to create the tasks. Once the tasks are generated, they're sent to Outlook. My problem is the tasks are grouped in categories and if a due date is changed it needs to move all the following tasks by x number of days. (My keyfield ie- 57-41, then 57-42, etc. is stored in the contacts field) I had planned to first pull the data back to Access to see what dates changed. Off of that data, I'd delete the following tasks and reinsert them with the modified dates. I would prefer to do this in Outlook but do not know the Outlook object mod...

".pst is not a personal folders file"
Bought a new computer when hard drive died. Luckily I had a recent backup of data. Copied my data files over to my new computer, including the Outlook.pst I have been using in Outlook 2003 just fine. Got Outlook 2003 up and running just fine, except .... Regardless of what I do, I cannot get Outlook to open the Outlook.pst file. I keep getting an error that says "Outlook.pst is not a personal folders file". I've tried opening it as the new format, as the old format, tried importing it, etc... Outlook won't accept it any way. So I thought that file might be ...