Solved

Copy files via VB Script

Posted on 2013-01-08
3
326 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 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

Technology Partners: 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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

688 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