for /R "Destination_Folder" %%I in ("*.zip") do (
"%ProgramFiles%\7-Zip\7z.exe" x -y -aos -o"%%~dpI" "%%~fI"
"if errorlevel 1 goto :error"
del "%%~fI"
":error"
)
#get the list of zip files from the current directory
$dir = dir *.zip
#go through each zip file in the directory variable
foreach($item in $dir)
{
Expand-Archive -Path $item -DestinationPath ($item -replace '.zip','') -Force
}
5条答案
按热度按时间nwsw7zdq1#
试试这个:
字符串
或者(如果您想将文件解压缩到以Zip文件命名的文件夹中):
型
gt0wga4j2#
Ansgar上面的回应对我来说非常完美,但我也想在提取成功后删除存档。我发现了这个并将其纳入上述内容以给予:
字符串
bvk5enib3#
试试这个.
字符串
zhte4eai4#
有没有可能你的zip文件的名字中有空格?如果是这样,你的第一行应该是:
字符串
注意` instead of '的用法见FOR /?
uemypmqf5#
作为PowerShell脚本(没有第三方工具),您可以运行:
字符串
取自用户'pestell159'发布的Microsoft论坛。