How can I make Total Commander show actual size instead "size on disk" in the "size" column, while keeping the dynamic view (x.x k/M/G)?

Solution 1:

Do you mean you have set up a custom view and that you want dynamic sizes in the size column? I've done this by settings size to [=tc.size.bkMG2]

Solution 2:

You can utilize WinScriptAdv plugin. This is tested with Total Commander 9.12 x64.

To create a custom column with explorer rounded size display.

  1. Download and install the plugin
  2. Locate the plugin directory and modify options.ini
  3. Add to ActiveScripts "|SizeOnDisk" if ActiveScripts not empty, if it is empty, then "ActiveScripts=SizeOnDisk"

Code:

[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
  1. Create a file with the name SizeOnDisk.vbs in the sub folder scripts and paste the following code into this file. I'm not an VBS programmer, so no guarantees, maybe someone with VBS knowledge might improve it

VBS Code:

'==============================================================================
'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
  1. Then Configure Custom Columns Custom Columns

  2. Add new custom columns configuration Custom column configuration

  3. Then add new Column and place in caption field "sizeondisk" and in "Field contents" next text "[=winscriptsadv.sizeondisk]". enter image description here