Menu

#19 "qsize" AutoHotKey script submission

New
nobody
command (6)
Medium
2009-06-12
2008-08-02
Anonymous
No

Originally created by: kijoshua...@gmail.com

/*
calculate the size of the selected files/folders (recursive)

sure... Alt-Enter gets you the property page for all the selected
items, which also has the size.  But this way is much quicker when
used repeatedly (like trying to guess what combination of items
will fit perfectly on a DVD)

I found this thing invaluable when trying to do the above mentioned task
on a slower network folder (right clicks took insanely long, and
I didn't need to see a full property page... just the size and number of
items).

The results pop up as a tool tip when their ready, and hang around for five
seconds.

A new size request does not cancel the first one (multiple tooltips will
show up without
issue)

*/
    unit_list =B KB MB GB TB PB EB ZB YB
    ;I await the day when I'll be using such large units!! (Oh, its only 1.4
ZB...)

    StringSplit, units, unit_list, %A_Space%
    TotalSize:=0

    num_files := 0

    Loop %0%
    {
        file := %A_Index%
        FileGetSize, size, %file%
        TotalSize += %size%
       
        FileGetAttrib, Attributes, %file%
       
        IfInString Attributes, D
        {
            Loop, %file%\*.*, , 1
            {
                num_files++
                TotalSize += %A_LoopFileSize%   
            }       
        }
        else
            num_files++
    }

    Loop
    {
        unit := units%A_Index%
        if TotalSize < 1024
            break
        TotalSize := TotalSize / 1024.00
    }

    ToolTip, Size: %TotalSize% %unit% in %num_files% files
    sleep 5000
    ToolTip
return

Discussion

  • Anonymous

    Anonymous - 2008-08-02

    Originally posted by: tortoisesvn

    (No comment was entered for this change.)

    Labels: -Type-Defect command

     
  • Anonymous

    Anonymous - 2008-08-02

    Originally posted by: kijoshua...@gmail.com

    Compiled version (doesn't require AutoHotKey to run)

     
  • Anonymous

    Anonymous - 2009-06-12

    Originally posted by: jst...@mailjar.com

    not to take away from the usefulness of this script but I use another explorer addin
    called FolderSize (http://foldersize.sourceforge.net/).  It adds another column (or
    columns, it has a number of settings) that shows the size of all folders/files.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.