Solved

Copy files in a directory NOT the entire folder possible?

Posted on 2013-01-03
6
310 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

785 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