Menu

Search



Using a Configuration Group to Check Last Modified Date of a File

New Boundary Support
Tips & Tricks

The information in this article applies to:  Prism Suite, Prism Deploy

 

Problem:

It would be useful to have a configuration group that checks for the existence of a file and also checks its modified date. For example, this would be one way of checking if a certain anti-virus .dat file was up to date. It is possible with all versions of Prism Deploy to check for the existence of a file in a user-defined config group, but there isn’t currently a user-defined parameter to check for the last modified date of a file.

 

Resolution:

NBT Support has come up with a workaround using a VB script. The process is to create and run a VB script that captures the timestamp of the file and writes that information to an INI file. You can then use the INI file in your ruleset to see modified date is what you expect. In our example below, we’re checking to see if the Symantec file called savrt.dat is up to date.

 

First, use notepad to create a .vbs script with the lines shown below. On line 1, specify the path to the file you're interested in. On line 4, specify the path and file name for the INI file that will be created.

 

Const filename = "C:\Program Files\Symantec AntiVirus\savrt.dat"

Dim objFSO, objFile, objINIFile

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.GetFile(filename)

Set objINIFile = objFSO.CreateTextFile("C:\LastModified.ini", 2)

objINIFile.WriteLine "[Date Modified]"

objINIFile.WriteLine "Date Modified=" & objFile.DateLastModified

objINIFile.Close

 

Run the vbs script as a Command Task in your Channel, then create a config group based on the entry in the INI file created by the script. Here's our example:

 

EXISTS <File> "C:\Program Files\Symantec AntiVirus\savrt.dat" AND <INI Value> "C:\LastModified.ini\\Date Modified\\Date Modified" MATCHES "1/6/2006*"

 

Important Notes:

1) If the file’s modified date changes, the LastModified.ini will not automatically reflect that change. The VB script would have to be run again, perhaps as a recurring task. We recommend configuring the Command Task to recur at user logon.

2) Windows Script Host is preinstalled on Windows 98, Windows 2000 and above. It is available separately for Windows 95 and Windows NT 4.


Also In This Category


On a scale of 1-5, please rate the helpfulness of this article


Not Helpful
Very Helpful
Optionally provide your comments to help us improve this article...

Thank you for your feedback!

Add Your Comments
Name:
Email Address:
RadEditor - HTML WYSIWYG Editor. MS Word-like content editing experience thanks to a rich set of formatting tools, dropdowns, dialogs, system modules and built-in spell-check.
RadEditor's components - toolbar, content area, modes and modules
   
Toolbar's wrapper  
Content area wrapper
RadEditor's bottom area: Design, Html and Preview modes, Statistics module and resize handle.
It contains RadEditor's Modes/views (HTML, Design and Preview), Statistics and Resizer
Editor Mode buttonsStatistics moduleEditor resizer
 
 
RadEditor's Modules - special tools used to provide extra information such as Tag Inspector, Real Time HTML Viewer, Tag Properties and other.
   
Verification Code:
Details
Last Modified: 12 Years Ago
Last Modified By: New Boundary Support
Type: HOWTO
Rated 1 star based on 13 votes.
Article has been viewed 12.2K times.
Options
Customer Support Software By InstantKB 2015-2
Execution: 0.000. 15 queries. Compression Disabled.