Friday, 15 March 2013

windows - How to know the size of .cab file content without expanding it using PowerShell? -



windows - How to know the size of .cab file content without expanding it using PowerShell? -

for example, have file demo.cab. want know size of files(extracted!) within demo.cab. don't want extract files it.

how can using windows powershell?

thanks help!

you have utilize cabarc.exe tool. utilize l parameter list content of cabinet file. outputs unwated text have skip first 9 lines. replace "more 1 space" space , create csv file. finaly phone call measure-content sum of files size :

cabarc.exe l .\hpchl118.cab > c:\temp\cab.txt ((gc c:\temp\cab.txt |skip -first 9) -replace '\s+',' ' | ` convertfrom-csv -delimiter " " -header "file","size","date" | ` measure -property size -sum | select -expand sum)/1mb

windows powershell cab

No comments:

Post a Comment