Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Check if certain files exist in a directory, if not add their names to a textfile

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Check if certain files exist in a directory, if not add their names to a textfile
  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 >>
 Check if certain files exist in a directory, if not add... - 2/7/2008 4:21:59 AM   
  SunnyK

 

Posts: 1
Score: 0
Joined: 2/7/2008
Status: offline
We receive some logs on our windows box via FTP on a daily basis, in the 'logs' directory. I would like to check for missing log files and add their name to a textfile.

Something like...

Create C:\missingfiles_ydate.txt
Check if C:\logs\abc_system1_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\def_system1_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\ghi_system1_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\abc_systemx5_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\def_systemx5_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\ghi_systemx5_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\abc_system6_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\def_system6_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Check if C:\logs\ghi_system6_ydate exists (if not, add this filename to C:\missingfiles_ydate.txt)
Close C:\missingfiles_ydate.txt

Some other details:

1. I need to use ydate (currentdate-1), and the date format is YYMMDD (e.g. 080207)
2. The VBScript should check directory C:\logs for the above files, and appends missing filenames to C:\missingfiles_ydate.txt

Many Thanks,
SunnyK
 
 
Post #: 1
 
 RE: Check if certain files exist in a directory, if not... - 2/7/2008 6:06:17 AM   
  ebgreen


Posts: 4972
Score: 31
Joined: 7/12/2005
Status: offline
What have you tried so far. We help you write the script. I general we don't write the script for you.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to SunnyK)
 
 
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 >> Check if certain files exist in a directory, if not add their names to a textfile 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