http://img14.imageshack.us/img14/9260/driveinfo6qi.png
So geht's:
1. Zunächst lege man sich 26 Dummy-Dateien mit den Dateinamen <[-A-]> bis <[-Z-]> an, am besten in einem neuen Verzeichnis.
2. Dann definiere man eine benutzerdefinierte Spalte mit dem Feldinhalt
"[=script.Result]"
3a. Nun kann man das Script <DriveInfo.vbs> werkeln lassen:
Code: Select all
'Script for Script Content Plugin
'(c)Lev Freidin, 2005
'http://www.totalcmd.net/plugring/script_wdx.html
'http://wincmd.ru/plugring/script_wdx.html
Dim fso, dc
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d In dc
'Verfügbare Eigenschaften (mit '+' gekennzeichnete Eigenschaften werden durch das Script angezeigt)
'+ d.AvailableSpace
'+ d.DriveLetter
'+ d.DriveType
'+ d.FileSystem
'- d.FreeSpace
'+ d.IsReady
'- d.Path
'- d.SerialNumber
'+ d.ShareName
'+ d.TotalSize
'+ d.VolumeName
If filename = "[-" & d.DriveLetter & "-]" Then
Select Case d.DriveType
Case 0: strDriveType = "Unbekannt"
Case 1: strDriveType = "Wechselplatte"
Case 2: strDriveType = "Festplatte"
Case 3: strDriveType = "Netzwerk"
Case 4: strDriveType = "CD-ROM"
Case 5: strDriveType = "RAM-Disk"
End Select
'strDriveInfo = d.DriveLetter & " • " & strDriveType
strDriveInfo = strDriveType
If d.IsReady Then
If d.DriveType = 3 Then
strDriveInfo = strDriveInfo & " [" & d.ShareName & "]"
Else
If d.VolumeName = "" Then
strDriveInfo = strDriveInfo & " [_ohne_]"
Else
strDriveInfo = strDriveInfo & " [" & d.VolumeName & "]"
End If
End If
strDriveInfo = strDriveInfo & " • " & d.FileSystem
intExp = Fix(Log(d.TotalSize) / Log(1024))
Select Case intExp
Case 0: strUnit = " Bytes"
Case 1: strUnit = " KiB"
Case 2: strUnit = " MiB"
Case Else
intExp = 3
strUnit = " GiB"
End Select
strDriveInfo = strDriveInfo & " • " & FormatNumber(d.TotalSize / (1024^intExp), 2) & strUnit & " gesamt"
'strDriveInfo = strDriveInfo & " • " & FormatNumber(d.FreeSpace / (1024^intExp), 2) & strUnit
'strDriveInfo = strDriveInfo & " (" & FormatPercent(d.FreeSpace / d.TotalSize, 0) & ") verfügbar"
strDriveInfo = strDriveInfo & " • " & FormatNumber(d.AvailableSpace / (1024^intExp), 2) & strUnit
strDriveInfo = strDriveInfo & " (" & FormatPercent(d.AvailableSpace / d.TotalSize, 0) & ") verfügbar"
'strDriveInfo = strDriveInfo & " • " & FormatNumber((d.TotalSize - d.FreeSpace) / (1024^intExp), 2) & strUnit
'strDriveInfo = strDriveInfo & " (" & FormatPercent(1 - d.FreeSpace / d.TotalSize, 0) & ") belegt"
strDriveInfo = strDriveInfo & " • " & FormatNumber((d.TotalSize - d.AvailableSpace) / (1024^intExp), 2) & strUnit
strDriveInfo = strDriveInfo & " (" & FormatPercent(1 - d.AvailableSpace / d.TotalSize, 0) & ") belegt"
Else
strDriveInfo = strDriveInfo & " • Laufwerk nicht bereit (Kein Datenträger eingelegt)"
End If
End If
Next
content = strDriveInfo
3b. Die zum o.g. Script passende <Script.ini>:
Code: Select all
[Script]
Section=DriveInfo
[Defaults]
LongName=1
ParseDirs=0
[DriveInfo]
LongName=0
ParseDirs=0
Script=driveinfo.vbs