how to get the specific files using VB scripts

Hi ,

I have a problem, I am using a batch file to run performance analysis logs. The batch file is running good but the.csv file that i am using for generating the reports will be changing every day. the format of the log file is xyz_logs_220.csv. The last number will be increasing on daily basis, say for example on monday the name of the log file will be xyz_logs_221.csv.

I came to know that there is a way to automate the process of copying the log files. But since i  am a new bee to VB script i need your guidance

Thanks

VJ
VJ1980Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
Can you be more specific about what you need help with?  What are you trying to copy?  And what are the file(s) that should copied, just the one created today, or something else?  Have you considered naming the file something like xyz_logs_yyyymmdd.csv?

~bp
VJ1980Author Commented:
Hi Billprew,

Here is my exact requirement, I am running PAL tool on server (A). The purpose of this tool is to generate reports based on the perfmon counter logs. Every day from server (B) & Server(C), i need to copy the files to server (A) and then run the tool, the naming convention of the file is predefined as xyz_logs_0000262.csv (or) xyz_logs_0000263.csv, i just need a script which will copy the log files to Server (A)

Any idea

Thanks

VJ
Bill PrewIT / Software Engineering ConsultantCommented:
Rather than VBS I would look at doing this from a BAT file, using the XCOPY command.  The /M option can copy only files with the archive attribute set, and then reset it on the source.  This way you get only the files added or modified that day.  Or the /D option with no date will copy only files newer than the target folder.  For example:

XCOPY "\\serverA\share\dir\*.csv" "\\serverA\share\dir\" /D /I /Y

~bp

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Bill PrewIT / Software Engineering ConsultantCommented:
Will the files accumulate on the B and C servers over time, or once they are copied to A are they deleted?  If deleted, then couldn't you just copy all new files?

Will the files copied to A stay there after processed, or will they be deleted?

Can the sequence numbers from B and C ever be the same, and if so then what name would you use for them on server A.

~bp
VJ1980Author Commented:
hi Bill,

The files will be accumulated on server A as a backup. The sequence number will vary on both the servers. Each files will be maintained on a seperate folder for b & c server
Bill PrewIT / Software Engineering ConsultantCommented:
So you probably want something like this, right?

XCOPY "\\serverB\share\dir\*.csv" "\\serverA\share\dirB\" /D /I /Y
XCOPY "\\serverC\share\dir\*.csv" "\\serverA\share\dirC\" /D /I /Y

~bp
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.