TCは、「サイズ」列に「ディスク上のサイズ」を表示します。たとえば、 ShellDetails を使用できますが、シェルによって提供されない動的サイズ表示(x.x k/M/G)も必要です。
カスタムビューを設定していて、サイズ列に動的サイズが必要なことを意味しますか?サイズを[=tc.size.bkMG2]
に設定してこれを行いました
WinScriptAdvプラグイン を利用できます。これは、Total Commander 9.12x64でテストされています。
Explorerの丸めサイズ表示でカスタム列を作成します。
コード:
[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|SizeOnDisk
; List of scripts that will work together, returning their info in columns in one panel.
; Separated by "|" - script1|script2 etc. One script can have multiple columns and display info with other
; scripts that also can be with multiple columns, all in one group of columns.
; You can add all scripts to ActiveScripts - it does not affect the performance (but takes more memory to
; load and save script code), cause script runs only if you have the corresponding visible column in TC.
[SizeOnDisk]
; File Size with Explorer rounding in kB
Script=SizeOnDisk.vbs
content=sizeondisk
extensions=*
FoldersPaths=0
VBSコード:
'==============================================================================
'Script for WinScriptAdv content plugin
' content - Size on Disk (Like Explorer column)
'==============================================================================
Set FSO = CreateObject("Scripting.FileSystemObject")
content = Result(filename)
Set FSO = Nothing
Function Result(pPath)
If FSO.FileExists(pPath) Then
Dim F : F = FSO.GetFile(pPath)
Dim oShell, oFSO, oEnv, oNet
Set oShell = CreateObject("Wscript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oEnv = oShell.Environment("Process")
Set oNet = CreateObject("WScript.Network")
Dim sTempFile, aText, i, aInfo
sTempFile = oFSO.GetAbsolutePathName(oFSO.GetTempName)
oShell.Run "%comspec% /c compact " & Chr(34) & F & Chr(34) & " > " & Chr(34) & sTempFile & Chr(34), 0, True
aText = Split(oFSO.OpenTextFile(sTempFile,1).ReadAll,vbCrLf)
If oFSO.FileExists(sTempFile) Then oFSO.DeleteFile sTempFile, True
For i = 0 To UBound(aText)
If InStr(aText(i),oFSO.GetBaseName(F)) Then
aInfo = Split(Replace(aText(i),"=",":"), ":")
If IsNumeric(Trim(aInfo(1))) Then
Result = Trim(aInfo(1))
End If
End If
Next
set F = Nothing
End If
End Function