New Boundary Support Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



How to check a file sizeExpand / Collapse
Author
Message
Posted 1/22/2007 8:42:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 1/23/2007 5:31:28 AM
Posts: 1, Visits: 25
Is it possible to create a group based on the size of a file - i know where the file exists but it doesn't have a version number so the only way to distinguish the various versions is by its size.

Time flies like an arrow, fruit flies like a banana.
Post #1418
Posted 1/22/2007 11:16:29 AM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 2:43:01 PM
Posts: 657, Visits: 797
There isn't currently a drop-down choice for file size when creating a user-defined Configuration Group.  However, there is a workaround using a VBscript.  You can create and assign (as a Command Task) a VB script that will calculate a specified file's size and store that value in an INI file on the managed PC. You can then create a user-defined Configuration Group based on the value written to the INI file. For example,  the following VB script  allows you to find out the size of the paging file:

Create the following lines in a text editor, and save the file with the extension .vbs:

 

Const filename = "C:\pagefile.sys"

Dim objFSO, objFile, objINIFile

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.GetFile(filename)

Set objINIFile = objFSO.CreateTextFile("C:\Program Files\New Boundary\Client\PagefileSize.ini", 2)

objINIFile.WriteLine "[FileSize]"

objINIFile.WriteLine "Bytes=" & objFile.Size

objINIFile.Close

This script will calculate the size of the "C:\PageFile.sys" file and then store the value in a file called PagefileSize.ini in the Prism Client folder.

The next step is to create a User-defined Configuration Group to query the INI file. Let’s say you want to find out all the systems where the pagefile.sys is over 1GB in size. Use the following rule as an example:

<INI Value> "C:\Program Files\New Boundary\Client\PagefileSize.ini\\FileSize\\Bytes" > 1000000000

Make sure that there aren't any quote symbols around the numeric value in the rule, otherwise it will be treated as a string. The Configuration Group will populate with any computer that has an INI file named PagefileSize.ini in the C:\Program Files\New Boundary\Client folder, has a section called [PageFileSize] and a “Bytes” value greater than 1000000000.

Note: When PageFile.sys size changes, the PagefileSize.ini will not automatically reflect that change. The VB script would have to be run again to get the latest size. You could consider setting it up as a recurring task, perhaps monthly.

Please contact us directly at support@newboundary.com if you would like some assistance in creating your script and creating the configuration group(s).



New Boundary Technologies Support
support@newboundary.com

Post #1419
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: New Boundary Support

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 9:49pm

Powered By InstantForum.NET v4.1.3 © 2008
Execution: 0.203. 11 queries. Compression Enabled.