Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Find from file list and then copy to location

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61979
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Find from file list and then copy to location
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Find from file list and then copy to location - 6/29/2008 10:08:48 PM   
  mixta2008

 

Posts: 2
Score: 0
Joined: 6/29/2008
Status: offline
Hello,

I have searched the forum and can't seem to locate anything on what I want to try and do.  I am a novice though so that may explain alot.

I have the directory c:\DailyFiles\Extracted\ with 6 different Excel files in them.  Names range of the excel files are all different and change daily.  E.g 151. 3018 TLS Data Dump- 27th June 2008.xls

What I am trying to do is copy these files once I have extracted them to this directorty to copy them to separate locations.   I have the following code which works if I specify the filename but what I would liek is a loop that will look at the name of each file, look for a selection of common text eg. 3018 and move it to the directory that I want it to go too all from running the vbs file.


      

The bits that change in thefile are 151. 3018 TLS Data Dump- 27th June 2008.xls

The numbers are sequential but we work monday to friday so this needs to be taken into account. 

Does anyone know how I could use a for... next or do... loop function like

do until mid(filename, 4, 9) = 3018
   filename = filename
   exit do
loop

Is this possible?

Thanks for any help provided and thanks in advance.

Mike
 
 
Post #: 1
 
 RE: Find from file list and then copy to location - 6/30/2008 12:19:09 AM   
  mixta2008

 

Posts: 2
Score: 0
Joined: 6/29/2008
Status: offline
Hello,

Did more searching around the place and figured it out.

Code to replace some of the above to get it to work is :


      

It may not be the best way but it works great.

Thanks anyway

(in reply to mixta2008)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Find from file list and then copy to location Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts