• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 316
  • Last Modified:

Copy files in a directory NOT the entire folder possible?

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
elwayisgod
Asked:
elwayisgod
  • 3
  • 3
1 Solution
 
QlemoC++ DeveloperCommented:
objFSO.CopyFile SOURCEDIR & "\Data" & "\*", TARGETDIR & "\", True

Open in new window

0
 
elwayisgodAuthor Commented:
If target files exist will it overwrite them automatically with no pop ups?
0
 
QlemoC++ DeveloperCommented:
Yes, that is what the True is for.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
elwayisgodAuthor Commented:
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
 
elwayisgodAuthor Commented:
Perfect
0
 
QlemoC++ DeveloperCommented:
Yes, the copy has to be finished first before the command will return execution to your code.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now