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

Copy files via VB Script

I have this which works fine.  However it needs changed to this logic:  Copy every from source to target that ends with 'oracle_data_mdse.txt' as there will be many that are prefixed with the year.  Don't want to specify each one out.

objFSO.CopyFile "D:\Data\oracle_data_mdse.txt","D:\Output\oracle_data_mdse.txt"
0
elwayisgod
Asked:
elwayisgod
  • 2
1 Solution
 
dustockCommented:
Just put an astrix * in the text that you want it to end with
 
objFSO.CopyFile "D:\Data\*oracle_data_mdse.txt","D:\Output\oracle_data_mdse.txt"
0
 
elwayisgodAuthor Commented:
I was thinking that but wasn't sure.  How does it ensure the target file is same name as original though?
0
 
dustockCommented:
Just copy it to the folder D:\Output\ and it will keep the same file name.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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