Solved

Copy files in a directory NOT the entire folder possible?

Posted on 2013-01-03
6
311 Views
Last Modified: 2013-01-03
Can I easily have the code change to just copy all files in the directory and not copy the entire folder which includes sub folders that I don't want copied.  Want to keep it VB Script.

      objFSO.CopyFolder SOURCEDIR & "\Data", TARGETDIR & "\", True
0
Comment
Question by:elwayisgod
  • 3
  • 3
6 Comments
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 38740607
objFSO.CopyFile SOURCEDIR & "\Data" & "\*", TARGETDIR & "\", True

Open in new window

0
 

Author Comment

by:elwayisgod
ID: 38740643
If target files exist will it overwrite them automatically with no pop ups?
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 38740760
Yes, that is what the True is for.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 

Author Comment

by:elwayisgod
ID: 38740786
So I thought the True was for the script to wait until this part is done before continuing.  I guess not :)  Anyways, this will process before it continues on down the main script?
0
 

Author Closing Comment

by:elwayisgod
ID: 38741056
Perfect
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 38741244
Yes, the copy has to be finished first before the command will return execution to your code.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

821 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