No Description

Compression.ps1 1.1KB

1234567891011121314151617181920
  1. # Prompt the user to paste the list of folders to compress from the clipboard
  2. $folders = Read-Host "Please paste the list of folders to compress from the clipboard and press Enter"
  3. # Set the compression level (Valid values are low, medium, high, max, or blank for default)
  4. $level = "high"
  5. # Set the recursive option (Valid values are /S or blank for no recursion)
  6. $recursive = "/S"
  7. # Loop through the folders and invoke compact.exe for each one
  8. foreach ($folder in $folders) {
  9. # compact.exe uses advanced compression algorithms to compress the files and folders
  10. # The compression level determines which algorithm is used and how much space is saved
  11. # The pros and cons of each compression level are as follows:
  12. # low: Low compression, uses XPRESS4K, saves some space, fast and low CPU usage
  13. # medium: Medium compression, uses XPRESS8K, saves more space, moderate speed and CPU usage
  14. # high: High compression, uses XPRESS16K, saves even more space, slow and high CPU usage
  15. # max: Maximum compression, uses LZX, saves the most space, very slow and very high CPU usage
  16. compact /C /S /A /I /EXE:$level $recursive $folder
  17. }

Powered by TurnKey Linux.