Ⅰ 如何批量把大量的ZIP文件解壓,並把ZIP文件內的文件名稱更改成ZIP文件名稱
不清楚你的實際文件/情況,僅以問題中的樣例/說明為據;以下代碼復制粘貼到記事本,另存為xx.bat,編碼選ANSI,跟要處理的文件放一起運行
@echo off
rem 批量解壓多個zip壓縮包並將解壓出來的文件以該壓縮包的名稱重命名
mode con lines=5000
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
set "exefile=C:\Program Files\WinRAR\WinRAR.exe"
if not exist "%exefile%" (echo;"%exefile%" 未找到&pause&exit)
for /f "delims=" %%a in ('dir /a-d/b *.zip') do (
echo;"%%a"
"%exefile%" e -y "%%a" ".\%%~na\"
if exist ".\%%~na\" (
for /f "delims=" %%b in ('dir /a-d/b/s ".\%%~na\"') do (
move "%%b" ".\%%~na%%~xb"
)
rd /s /q ".\%%~na\"
)
)
echo;%#% +%$%%$%/%@% %z%
pause
exit
Ⅱ 批處理 壓縮文件
@echooff
rem多重壓縮/打包文件
set#=Anyquestion&set$=Q&set/az=0x53b7e0b4
title%#%+%$%%$%%z%
cd/d"%~dp0"
set"folder=com.huawei.aod"
set"winrar=C:ProgramFilesWinRARWinRAR.exe"
ifnotexist"%winrar%"(echo;"%winrar%"notfound&gotoend)
echo;壓縮".\%folder%"--^>".\%folder%.zip"
"%winrar%"a-r-ep1-y".\%folder%.zip"".\%folder%"
echo;刪除".\%folder%"
rd/s/q".\%folder%"
echo;重命名".\%folder%.zip"--^>"%folder%"
ren".\%folder%.zip""%folder%"
echo;壓縮"%~dp0"--^>".AOD.zip"
"%winrar%"a-r-ep1-y".AOD.zip""%~dp0"-x"%~nx0"
echo;重命名".AOD.zip"--^>"AOD.hwt"
ren".AOD.zip""AOD.hwt"
echo;%#%+%$%%$%%z%
pause
exit
Ⅲ 求教,如何用批處理將文件夾內,每個文件夾下所有內容壓縮為一個zip。
看看這個是否滿足您的需求,如有問題請追問。如滿意,請好評採納,謝謝!
Ⅳ 7-zip如何利用批處理壓縮及解壓縮文件夾
WINDOWS操作不行嗎。選中 你要打包的目錄,滑鼠右鍵彈出菜單選擇壓縮包文件名就行了
盤符路徑也可以選
7-ZIP,WIN ZIP,WIN RAR這些都是WINDOWS界面軟體了,
用命令行壓縮文件都是古老的DOS時期ARJ之類的軟體採用的
Ⅳ 批處理壓縮成zip
指定壓縮格式為
zip
時,就是按
zip
壓縮的。
可能是你解壓的程序的問題或者兼容性問題。
你可以用
winzip
或
7-zip
解壓看看
Ⅵ 批處理壓縮成zip
指定壓縮格式為 zip 時,就是按 zip 壓縮的。
可能是你解壓的程序的問題或者兼容性問題。
你可以用 winzip 或 7-zip 解壓看看
Ⅶ 求教,如何用批處理將每個子文件夾下所有內容壓縮為zip
@echooff
::設置7ZIP路徑
set"zip=C:ProgramFiles7-Zip7z.exe"
::設置操作目錄
set"SourDir=F:download"
cd/d"%SourDir%"
echo開始壓縮……
for/f%%iin('dir/a-d/b/s')do(
if"%%~xi"NEQ".zip"(
"%zip%"a"%%~dpni.zip""%%i">nul
::確認壓縮文件解壓後可用,把下面一行的echo去掉以刪除源文件
echodel/f"%%i"
)
)
echo處理完成&pause>nul
Ⅷ 如何批量把大量的ZIP文件解壓,並把ZIP文件內的文件名稱更改成ZIP文件名稱
不清楚你的實際文件/情況,僅以問題中的樣例/說明為據;以下代碼復制粘貼到記事本,另存為xx.bat,編碼選ANSI,跟要處理的文件放一起運行
@echo off
rem 批量解壓多個zip壓縮包並將解壓出來的文件以該壓縮包的名稱重命名
mode con lines=5000
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
set "exefile=C:\Program Files\WinRAR\WinRAR.exe"
if not exist "%exefile%" (echo;"%exefile%" 未找到&pause&exit)
for /f "delims=" %%a in ('dir /a-d/b *.zip') do (
echo;"%%a"
"%exefile%" x -y "%%a" ".\%%~na\"
if exist ".\%%~na\" (
for /f "delims=" %%b in ('dir /a-d/b/s ".\%%~na\"') do (
ren "%%b" "%%~na%%~xb"
)
)
)
echo;%#% +%$%%$%/%@% %z%
pause
exit
Ⅸ 批處理解壓zip
命令格式用錯了,另外rar好像不支持通配符操作多文件。我把批處理給您改一下:
@echo off
@for /f "delims=" %%i in ('dir *.rar /b') do @rar -e "%%i%
@pause
您試試看。
另外,rar.exe必須在全局路徑中,最好是拷貝到windows目錄下。
Ⅹ 如何寫一個壓縮文件的批處理或小程序
不清楚你的實際文件/情況,僅以問題中的樣例說明及猜測為據;以下代碼復制粘貼到記事本,另存為xx.bat,編碼選ANSI,跟要處理的文件放一起雙擊運行
<#:
cls&echooff&cd/d"%~dp0"&modeconlines=5000
rem將當前目錄里的多個.vcf文件按照不同數量分組進行壓縮打包
set#=Anyquestion&set_=WX&set$=Q&set/az=0x53b7e0b4
title%#%+%$%%$%/%_%%z%
set"exefile=C:ProgramFilesWinRARWinRAR.exe"
ifnotexist"%exefile%"(echo;"%exefile%"PathErrororNotInstalled&pause&exit)
set"self=%~f0"
powershell-NoProfile-ExecutionPolicybypass"Get-Content-literal'%~f0'|Out-String|Invoke-Expression"
echo;%#%+%$%%$%/%_%%z%
pause
exit
#>
$ext=@(".vcf");
$relation=@"
小紅=20
小蘭=30
小剛=33
小李=22
"@;
$codes=@'
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Runtime.InteropServices;
publicstaticclassExpDir
{
[DllImport("Shlwapi.dll",CharSet=CharSet.Unicode)]
(stringp1,stringp2);
publicstaticstring[]Sort(string[]f)
{
Array.Sort(f,StrCmpLogicalW);
returnf;
}
}
'@;
Add-Type-TypeDefinition$codes;
$self=get-item-liter$env:self-force;
$current=$self.Directory;
$arr=$relation.trim()-split'[ ]+';
$files=@(dir-literal$current.FullName|?{($ext-contains$_.Extension)-and($_-is[System.IO.FileInfo])}|%{$_.Name});
if($files.length-ge1){
$brr=[ExpDir]::Sort($files);$n=0;
for($i=0;$i-lt$arr.length;$i++){
if(-not[string]::IsNullOrWhiteSpace($arr[$i])){
$crr=$arr[$i].split('=',2);$zipname=$crr[0]+'.zip';
for($j=1;$j-le([int]$crr[1]);$j++){
if($n-lt$brr.count){
write-host$brr[$n];$n++;
}
}
write-host("==>"+$zipname+"`r`n")-ForegroundColoryellow;
}
}
}