Windows archives extract

From snippet wiki
Jump to: navigation, search

How to extract several hundred archives under windows? Use the PowerShell with this short loop:

 foreach ($file in Get-ChildItem Z:\downloads\*.7z)
 {
  Write-Host $file
  Set-Variable mybname -value $file.BaseName
  Write-Host $mybname
  Set-Variable mycommand -value "c:\tools\7za x -oZ:\ziel\$mybname -y $file"
  Write-Host $mycommand
  invoke-expression "$mycommand"
 }

Autoren der Seite / Contributors of the page

» Kai Kretschmann, (google+)