[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Copy files via VB Script

Posted on 2013-01-08
3
Medium Priority
?
330 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
dustock earned 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 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