Link to home
Start Free TrialLog in
Avatar of VJ1980
VJ1980

asked on

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
Avatar of Bill Prew
Bill Prew

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
Avatar of VJ1980

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of VJ1980

ASKER

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
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