Link to home
Start Free TrialLog in
Avatar of harps21k
harps21kFlag for United Kingdom of Great Britain and Northern Ireland

asked on

.vbs Script to find last modified date of latest files in folder

Hi Guys,

Due to the limitation of sophos on netware we are left not with no report for last AV update at a central location. So we have to go and manually check the status on every server.

So I started to create a batch script to run and verify all the files for the last modified date in a folder on the server which would tell me if the definitions are up to date. Doing this script in batch was limited. So need help creating script in .vbs

Can anyone help create a script which will:
1 - Go check the file modified date in many folders and return the output to a excel or a txt file with the following messages:
"Completed" if the modified date of any file is NOT older than 6 hours.
"Failed" if the modified date of any file is older than 6 hours.

2- The script would have to exclude the .cfg and .log file types from be checked for last modified date.

3-  The script would need a loop and run on many servers which can be listed in a variable at the top of the script. Also amend the output file with the status of every server after a loop.

The folder location on each netware server would be:
<ServerName>\sys\sweep\

Thanks Guys
Avatar of rejoinder
rejoinder
Flag of Canada image

Just to clarify - you want to check the times of all files with the exception of .log and .cfg files that are located in a number of folders.  If even one of the files within any of the folders is older than 6 hours report a failure otherwise the machine is up to date?
Avatar of harps21k

ASKER

Yeh I would like it to check for everything except the .cfg and .log file.

Basically I need it to query for anyone of the most recent updated file and report as failed if that file has been modified older than 6hours.  Also report as completed if the most recent updated file is newer than 6hours.

I don't know which file would be updated that why I need it to query for anyone of the files to find at least 1 recent modified file to report the update status. Also have the exclusion mentioned above.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of merowinger
merowinger
Flag of Germany image

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
Testing
Any update?