Solved

Copy files in a directory NOT the entire folder possible?

Posted on 2013-01-03
6
307 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 68

Accepted Solution

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

Open in new window

0
 

Author Comment

by:elwayisgod
Comment Utility
If target files exist will it overwrite them automatically with no pop ups?
0
 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
Yes, that is what the True is for.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:elwayisgod
Comment Utility
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
Comment Utility
Perfect
0
 
LVL 68

Expert Comment

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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now