' FolderProperties.vbs ' Provides all the information available on a given folder ' --------------------------------------------------------- Const ReadOnly = 1 Const Hidden = 2 Const System = 4 Const Directory = 16 Dim dirName If WScript.Arguments.Count = 0 Then dirName = InputBox("Enter the FULLY-QUALIFIED name of the folder:") Else dirName = WScript.Arguments.Item(0) End if If dirName = "" Then WScript.Quit End If Set fso = CreateObject("Scripting.FileSystemObject") ' Attempt to get the folder If Not fso.FolderExists(dirName) Then MsgBox "Sorry, but the folder doesn't exist!" WScript.Quit End If Set f = fso.GetFolder(dirName) If f.IsRootFolder Then Set drive = fso.GetDrive(f.Drive) aText = Array( _ "Folder Name:" & vbTab & fso.BuildPath(f.Path, f.Name), _ "Short Name:" & vbTab & fso.BuildPath(f.ShortPath, f.ShortName), _ "Type of folder:" & vbTab & f.Type, _ "File System:" & vbTab & drive.FileSystem, _ "Volume Name:" & vbTab & drive.VolumeName, _ "Serial Number:" & vbTab & drive.SerialNumber, _ "Available Space: " & vbTab & FormatNumber(drive.AvailableSpace/1024), _ "Total Size: " & vbTab & drive.TotalSize) Else aText = Array( _ "Folder Name:" & vbTab & fso.BuildPath(f.Path, f.Name), _ "Short Name:" & vbTab & fso.BuildPath(f.ShortPath, f.ShortName), _ "Type of folder:" & vbTab & f.Type, _ "Created on:" & vbTab & f.DateCreated, _ "Accessed on:" & vbTab & f.DateLastAccessed, _ "Modified on:" & vbTab & f.DateLastModified, _ "Attributes: " & vbTab & FormatAttrib(f.Attributes), _ "Total Size: " & vbTab & f.Size) End if MsgBox Join(aText, vbCrlf) Function FormatAttrib(attr) str = "" If attr And ReadOnly Then str = str & "Readonly, " If attr And Hidden Then str = str & "Hidden, " If attr And System Then str = str & "System, " str = str & "Directory" FormatAttrib = str End Function Function FormatDriveType(drivetype) types = Array("Unknown", "Removable", "Local Partition", _ "Network Share", "CD-Rom Drive", "RAM Disk") FormatDriveType = types(drivetype) End Function