Disk Space archives - The VBScript Network and Systems Administrator's Cafe

The VBScript Network and Systems Administrator's Cafe:

Disk space

May 7 2009   2:39PM GMT

Essential tools: Treesize another disk free space utility with a powerful punch– and a low low price tag



Posted by: Jerry Lees
essential tools, Disk space, spacemonger, drive space, drivedpace, drive utilities, diskspace

This essential tool came to me as a comment submission some time back on another essential tool post I made, for SpaceMonger. The two tools display the same type data a litte differently, but depending on how you look at it you may prefer one over te other.

A big thanks to Eva007 for commenting on my previous post and sharing a truely great tool, Treesize with all of us! It offers some great features, including a no frill interface that lets you find which folders on a disk are using the most space. A truely essential tool when you administer a server and need to free up space on a drive.

Enjoy!

May 2 2009   6:19PM GMT

Using the VBScript datediff function to determine the age of a file by the last modified and the last accessed time



Posted by: Jerry Lees
VBScipt, VBScript Functions, file access, file modified, modification date, System Administration, Disk space, disk utilities

I recently needed a way to tell if a file had been accessed or modified recently, something that has always been a question when you’re out of space on a server and can’t just add more space to it. What do you delete??? The Old files are the obvious answer… except if people are using them.

Here is teh script I wrote to tell if a file had been accessed or modified in the last X days. In the example I use 5 days, but you can use a different number of days when you call the function.

Enjoy!

Option Explicit

Dim fName
Const DateLastModified = 1, DateLastAccessed = 2

fName=”c:\temp2.txt”

if FileAge(fname,5,DateLastAccessed) = True Then
WScript.Echo (”The file was accessed recently enough!”)
Else
WScript.Echo (”The file was not accessed recently enough!”)
End If

if FileAge(fname,5,DateLastModified) = True Then
WScript.Echo (”The file was modified recently!”)
Else
WScript.Echo (”The file was not modified recently!”)
End If

Function FileAge(fName,fAge, CompareType)
‘function returns True if the file is older than the fAge (File Age) specified and false if it isn’t
Dim LastModified, LastAccessed, FSO, DateDifference

Set FSO = CreateObject(”Scripting.FileSystemObject”)
LastModified = FSO.GetFile(fname).DateLastModified
LastAccessed = FSO.GetFile(fname).DateLastAccessed

Select Case CompareType
Case 1
DateDifference = DateDiff(”n”,LastModified, Now())
Case 2
DateDifference = DateDiff(”n”,LastAccessed, Now())

End Select
If DateDifference > fage Then
FileAge = False
Else
FileAge = True
End If
End Function


Aug 18 2008   5:48PM GMT

Essential Tools: Determining disk usage graphically with free tools



Posted by: Jerry Lees
free software, Disk space, drive space, Systems administrator tools, essential tools, windows tools, diskspace, drivespace, spacemonger

The next essential tool is one that I have used for quite some time now, and one I searched to find for some time. As a systems administrator, its an ever ending battle for you to keep space clear on the servers. It’s a battle that puts you smack in the middle of the users who are using all the space and the management who refuses to buy more space. Additionally, management all to often refuses to place a mandate on how old data is before it is free to delete.

 This tool won’t help you delete files, but it will tell you really quickly where exactly the space is being used for any particular volume… even if it is a UNC path on your network mapped to a network drive!

This tool, spacemonger, is a tool that will show you this in a visual representation by size where space is being used. It allows you to drill down into directories to see more detail and gives you shortcuts via a context menu to common tasks you would preform on a directory.

SpaceMonger truly is an essential tool. The 1.x version I’ve linked to is older, but free and it gets the job done. Additionally, a newer version is available that has more features and is relatively cheap. Go ahead, check it out… I’m sure you’ll add it to your essential tools!

Know of a tool that you think is essential? Post a comment here and if I don’t already have it in my tool belt, I’ll add it and give it a shot. If it makes the grade– I’ll add it to the list of tools to review. The only criteria are:

  1. The tool must be free, or inexpensive with a “Per User” or “site” type license. (No pay per installation licenses, please)
  2. The tool (or it’s installation file) must be small enough to fit on a 256Mb flash drive for portability.
  3. Command line run time options are beneficial, but not required.
  4. If it has ads… it needs be truly INVALUABLE.
  5. It should make the user’s job easier by gathering information or preforming a task that a typical Network or Systems Administrator would preform.

Enjoy!