Bonjour,
Voilà comment créer l'arborescence avec un batch :
1 2 3 4 5 6 7 8 9 10 11 12 13
| @echo off
setlocal enableextensions enabledelayedexpansion
for /f "tokens=1,* delims=_" %%A in ('2^>nul dir /b /a-d "D:\output\*.zip"') do (
set chemin=%%~nB
set chemin=!chemin:.=\!
powershell "%~dp0unzip.ps1" "D:\output\%%A_%%B" "J:\!chemin!"
)
exit |
Pour la décompression batch ne sait pas faire nativement, il faut donc créer un fichier unzip.ps1 (Powershell 5 est requis) contenant ceci :
Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force
J'espère que ça répond à ton problème.
Partager