EverythingFolderSize column (Calculate folder sizes via Everything tool)

Discuss and share scripts and script files...
Post Reply
Norn
Posts: 423
Joined: 24 Oct 2021 16:10

EverythingFolderSize column (Calculate folder sizes via Everything tool)

Post by Norn »

Index folder size.png
Index folder size.png (22.14 KiB) Viewed 462 times
EFS.PNG
EFS.PNG (16.26 KiB) Viewed 462 times
Last edited by Norn on 16 May 2023 20:14, edited 2 times in total.
Win10, Win11 @100% 2560x1440 22H2

Norn
Posts: 423
Joined: 24 Oct 2021 16:10

Re: EverythingFolderSize column (Calculate folder sizes via Everything tool)

Post by Norn »

Split into two parts, faster! Everything tool must be running!

To -> Configuration | General | Custom Event Actions | Before browsing a folder.

Code: Select all

/*
***************************************************************************************************
@Author  : https://www.xyplorer.com/xyfc/viewtopic.php?t=24909
@Created : 2022-07-23
@Modified: 2024-04-01
@Function: EverythingFolderSize column (Calculate folder sizes via Everything tool)   Configuration | General | Custom Event Actions | Before browsing a folder
@Version : v2.0
***************************************************************************************************
*/


    $EVsizeResults = "";
    if ($exec != 1 && exists(<newpath>)) {
        $es = """<xyscripts>\EV FOR XY\es.exe""";                                // es.exe path, Everything tool must be running
        if(!exists("%temp%\EFS\")) {new("%temp%\EFS", "dir")}                    // Make sure the path exists
        $txt_EFS = "%temp%\EFS\" . now("yymmdd-hhnn-ss.ff") . ".txt";            // Temp file path
        $content = "parent:""<newpath>"" /ad -size -no-header -export-csv";      // To search for
        run "$es $content $txt_EFS",,, 0;                                        // Run cmd
        wait 100;
    }

    perm $txt_EFS, $EVcase = $EVcase+1, $EVsizeResults;     // Global variables
To -> Custom column.

Code: Select all

/*
***************************************************************************************************
@Author  : https://www.xyplorer.com/xyfc/viewtopic.php?p=210711#p210711
@Created : 2022-07-23
@Modified: 2024-04-01
@Function: EverythingFolderSize column (Calculate folder sizes via Everything tool)
@Version : v2.0
***************************************************************************************************
*/


    if (!$EVsizeResults && exists($txt_EFS) == 1) {
        perm $EVsizeResults = readfile($txt_EFS)
    }
    if (!$EVsizeResults) {return}
	
    $EVitem = formatlist($EVsizeResults, "f", "<crlf>", "*" . "<cc_item>" . '"');
    if ($EVitem) {
        return formatbytes(gettoken($EVitem, 1, ',"'), "FLEX")
    } else {
        $cc_item = regexreplace(<cc_item>, "\[|#", "*");
        $EVitem = formatlist($EVsizeResults, "f", "<crlf>", "*" . $cc_item . '"');
        if ($EVitem) {
            return formatbytes(gettoken($EVitem, 1, ',"'), "FLEX")
        } else {
            return
        }
    }
EverythingFolderSize column.gif
EverythingFolderSize column.gif (1.02 MiB) Viewed 55 times
es.exe file:
EV FOR XY.zip
(453.1 KiB) Downloaded 9 times
https://www.voidtools.com/forum/viewtop ... f09#p66094

Toggle display of folder sizes:

Code: Select all

if ($exec != 1) {
    perm $exec = 1, $EVsizeResults = "", $txt_EFS = "";
    status "EFS off!";

    if ($EVcase > 50) {                                     // Clearing temp files
        delete 0, 0, "%temp%\EFS";
        perm $EVcase = "";
        status "EFS off! (Cache cleared)";
    }
 } else {perm $exec = 0; status "EFS on!"}
Win10, Win11 @100% 2560x1440 22H2

Post Reply