Solved

Copy files via VB Script

Posted on 2013-01-08
3
318 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
Comment Utility
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
Comment Utility
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
Comment Utility
Just copy it to the folder D:\Output\ and it will keep the same file name.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 …
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

10 Experts available now in Live!

Get 1:1 Help Now