(view source code of filedetails.vbs as plain text)
Option Explicit
Dim i, intKeyLength, intMaxLength
Dim objFolder, objFolderItem, objFSO, objShell
Dim strFile, strFileName, strKeyName, strMsg, strParentFolder
If WScript.Arguments.Unnamed.Count = 1 Then
strFile = WScript.Arguments.Unnamed.Item(0)
Else
Syntax
End If
Set objFSO = CreateObject( "Scripting.FileSystemObject" )
If objFSO.FileExists( strFile ) Then
strFileName = objFSO.GetFileName( strFile )
strParentFolder = objFSO.GetParentFolderName( strFile )
Set objShell = CreateObject( "Shell.Application" )
Set objFolder = objShell.Namespace( strParentFolder )
Set objFolderItem = objFolder.ParseName( strFileName )
intMaxLength = 0
For i = 0 To 300
strKeyName = objFolder.GetDetailsOf( objFolder.Items, i )
intKeyLength = Len( strKeyName )
If intKeyLength > intMaxLength Then intMaxLength = intKeyLength
Next
strMsg = "System Locale = " & GetLocale( ) & vbCrLf & vbCrLf
For i = 0 To 300
strKeyName = Trim( objFolder.GetDetailsOf( objFolder.Items, i ) )
If strKeyName <> "" Then
strMsg = strMsg _
& "[" & Right( "000" & i, 3 ) & "] " _
& Left( strKeyName & Space( intMaxLength ), intMaxLength ) _
& " = " _
& objFolder.GetDetailsOf( objFolderItem, i ) _
& vbCrLf
End If
Next
Set objFolderItem = Nothing
Set objFolder = Nothing
Set objShell = Nothing
WScript.Echo strMsg
Else
Syntax
End If
Set objFSO = Nothing
Sub Syntax( )
strMsg = "FileDetails.vbs, Version 1.00" _
& vbCrLf _
& "List file details for the specified file, in the system's language" _
& vbCrLf & vbCrLf _
& "Usage:" & vbTab & "CSCRIPT.EXE //NoLogo FileDetails.vbs filename" _
& vbCrLf _
& " or:" & vbTab & "CSCRIPT.EXE //NoLogo FileDetails.vbs filename > logfile 2>&1" _
& vbCrLf & vbCrLf _
& "Where:" & vbTab & "filename" & vbTab & "is the file to be examined" _
& vbCrLf _
& " " & vbTab & "logfile " & vbTab & "is the optional log file to receive FileDetails.vbs' output" _
& vbCrLf & vbCrLf _
& "Note:" & vbTab & "Output format is in ""[index] Property Name = Value"" format." _
& vbCrLf _
& " " & vbTab & """Property Name"" is system language dependent." _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" _
& vbCrLf _
& "http://www.robvanderwoude.com"
WScript.Echo strMsg
WScript.Quit 1
End Sub
page last modified: 2024-04-16; loaded in 0.0088 seconds