User Tools

Site Tools


powershell:extraer_zip_en_batch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
powershell:extraer_zip_en_batch [2026/08/20 13:30] – adm.wikipowershell:extraer_zip_en_batch [2026/08/26 14:57] (current) – adm.wiki
Line 1: Line 1:
-====== Extraer .zip en Batch ======+====== Extraer .zip en Batch/Serie ====== 
 +**partiendo desde aqui:** 
 +{{.:pasted:20260820-134350.png}}
  
 **Codigo:** **Codigo:**
  
-<code powershell>+<code powershell zip_extractor.ps1>
 $files = Get-ChildItem "F:\x360" -Filter "*.7z" -File $files = Get-ChildItem "F:\x360" -Filter "*.7z" -File
  
Line 23: Line 25:
 **Output** **Output**
 {{.:pasted:20260820-133016.png}} {{.:pasted:20260820-133016.png}}
 +
 +**Explicacion:**
 +  $files = Get-ChildItem "F:\x360" -Filter "*.7z" -File
 + crea la variable $files de tipo array con los nombres de archivo que terminan en .zip
 +  foreach ($file in $files)
 +foreach (bucle), trabaja con $file
 +  $destination = Join-Path "G:\x360iso" $file.BaseName
 +variable, $file.Basename, es igual a ej. "batman arkham city"  
 +  New-Item -ItemType Directory -Path $destination -Force | Out-Null
 +crea el directory "batman arkham city"
 +    Write-Host "Extrayendo: $($file.Name)"
 +Escribe/muestra en la terminal extrayendo "batman arkham city"
 +    & "C:\Program Files\7-Zip\7z.exe" x -y `
 +        $file.FullName `
 +        "-o$destination"
 +Descomprime en su carpeta destino, sin confirmacion, usando 7zip.
 +    Write-Host "Terminado: $($file.Name)"
 +ultimo mensaje en la terminal, y luego viene el siguiente string del array.
  
powershell/extraer_zip_en_batch.1787225442.txt.gz · Last modified: by adm.wiki