Solved

Copy files via VB Script

Posted on 2013-01-08
3
325 Views
Last Modified: 2013-01-08
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
Comment
Question by:elwayisgod
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
dustock earned 500 total points
ID: 38756001
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
 

Author Comment

by:elwayisgod
ID: 38756009
I was thinking that but wasn't sure.  How does it ensure the target file is same name as original though?
0
 
LVL 9

Expert Comment

by:dustock
ID: 38756030
Just copy it to the folder D:\Output\ and it will keep the same file name.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

730 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