RAR custom column

Discuss and share scripts and script files...
Post Reply
python80
Posts: 16
Joined: 08 Jul 2022 05:49

RAR custom column

Post by python80 »

It really works.

My sample columns:

Code: Select all

Column: Writing Application

$mediaInfo = "C:\Program Files\MediaInfo\MediaInfo.exe";
    return regexreplace(runret("$mediaInfo --Inform=General;%Encoded_Application/String% ""<cc_item>"""), "\r?\n");

Column: Writing Library

$mediaInfo = "C:\Program Files\MediaInfo\MediaInfo.exe";
    return regexreplace(runret("$mediaInfo --Inform=General;%Encoded_Library/String% ""<cc_item>"""), "\r?\n");
Is it possible for rar (winrar's command line tool) like mediainfo?

Dictionary Size, Recovery Record, Archive Lock etc. columns?
Winrar&gt;Tools&gt;Show Information
Winrar>Tools>Show Information
winrar.png (14.79 KiB) Viewed 892 times
I'm talking about only archives, not files inside the archives.

***

Parameter: l

Code: Select all

C:\Program Files\WinRAR>rar l "X:\Test.rar"

RAR 6.11 x64   Copyright (c) 1993-2022 Alexander Roshal   3 Mar 2022
Trial version             Type 'rar -?' for help

Test

Archive: X:\Test.rar
Details: RAR 5, solid, recovery record, lock

 Attributes      Size     Date    Time   Name
----------- ---------  ---------- -----  ----
    I.A....   4236440  2019-08-20 08:34  WRR v2.2.0.0.exe
    I.A....   2711920  2021-02-16 08:18  WRR64 v3.1.0.0.exe
----------- ---------  ---------- -----  ----
              6948360                    2
CC: Custom Column

Is this possible?

Code: Select all

Name      Size      CC: Version     CC: Recovery Record     CC: Lock Status
Test.rar  3.88 MB   RAR5            Avaible                 Locked
If it's not posssible is this possible?

Code: Select all

Name      Size      CC: Archive Details
Test.rar  3.88 MB   RAR 5, solid, recovery record, lock

Code: Select all

$rar = "C:\Program Files\WinRAR\rar.exe";
    return regexreplace(runret("$rar l ""<cc_item>"""), "\r?\n");
It's working but we have a very very long column.
Can we trim it? :)

Sorry for bad English and thanks for reading.

***

Parameter: va

Code: Select all

C:\Program Files\WinRAR>rar va "X:\Test.rar"

RAR 6.11 x64   Copyright (c) 1993-2022 Alexander Roshal   3 Mar 2022
Trial version             Type 'rar -?' for help

Test

Archive: X:\Test.rar
Details: RAR 5, solid, recovery record, lock

 Attributes      Size    Packed Ratio    Date    Time   Checksum  Name
----------- ---------  -------- ----- ---------- -----  --------  ----
    I.A....   4236440   1237532  29%  2019-08-20 08:34  25F58D93  WRR v2.2.0.0.exe
    I.A....   2711920   2628521  96%  2021-02-16 08:18  249ACA09  WRR64 v3.1.0.0.exe
----------- ---------  -------- ----- ---------- -----  --------  ----
              6948360   3866053  55%                              2
Parameter: vt

Code: Select all

C:\Program Files\WinRAR>rar vt "X:\Test.rar"

RAR 6.11 x64   Copyright (c) 1993-2022 Alexander Roshal   3 Mar 2022
Trial version             Type 'rar -?' for help

Test

Archive: X:\Test.rar
Details: RAR 5, solid, recovery record, lock

        Name: WRR v2.2.0.0.exe
        Type: File
        Size: 4236440
 Packed size: 1237532
       Ratio: 29%
    Modified: 2019-08-20 08:34:28,000000000
     Created: 2022-09-02 23:44:53,501791700
  Attributes: I.A....
       CRC32: 25F58D93
     Host OS: Windows
 Compression: RAR 5.0(v50) -m5 -md=8M

        Name: WRR64 v3.1.0.0.exe
        Type: File
        Size: 2711920
 Packed size: 2628521
       Ratio: 96%
    Modified: 2021-02-16 08:18:48,000000000
     Created: 2022-09-02 23:44:53,539748100
  Attributes: I.A....
       CRC32: 249ACA09
     Host OS: Windows
 Compression: RAR 5.0(v50) -m5 -md=8M
       Flags: solid

python80
Posts: 16
Joined: 08 Jul 2022 05:49

Re: CC snippet - Video length

Post by python80 »

My custom column script:

Code: Select all

$rar = "C:\Program Files\WinRAR\rar.exe";
    return regexreplace(runret("$rar l ""<cc_item>"""), "\r?\n");
Custom Column:

Code: Select all

RAR 6.11 x64   Copyright (c) 1993-2022 Alexander Roshal   3 Mar 2022Registered to xxxArchive: X:\Test\Test.rarDetails: RAR 4, solid, lock Attributes      Size     Date    Time   Name----------- ---------  ---------- -----  ----    I.A....   4236440  2019-08-20 08:34  WRR v2.2.0.0.exe    I.A....   2711920  2021-02-16 08:18  WRR64 v3.1.0.0.exe----------- ---------  ---------- -----  ----              6948360                    2
I want to see only details (Details: RAR 4, solid, lock) on the custom column.

Archive Details (Custom Column): RAR 4, solid, lock

Can we force to show only the part between "Details: " and " Attributes" by adding something to the script?
("Details: * Attributes")

Really sorry for my bad English.

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: RAR custom column

Post by highend »

Code: Select all

return gettoken(gettoken(regexreplace(runret("""$rar"" l ""<cc_item>"""), "\r?\n"), 2, "Details: "), 1, " Attributes");
One of my scripts helped you out? Please donate via Paypal

Post Reply