楼上来了个RAR,我就来个7ZIP- @echo off
-
- rem 设置7ZIP路径
- set "path=%path%;C:\Program Files\7-Zip"
-
- rem 设置解压密码
- set "password=123456"
-
- for /r %%a in (*.rar,*.7z,*.zip) do (
- set "archpath=%%a"
- set "archname=%%~na"
- for /f "skip=18 tokens=6 delims= " %%b in ('7z l "%%a" *.* -p"%password%" -r^|find /v "files"') do (
- set "fullname=%%b"
- set "basename=%%~nb"
- call :get_name
- )
- )
- pause&exit
-
- :get_name
- call,set "newname=%%fullname:%basename%=%archname%%%"
- 7z rn "%archpath%" "%fullname%" "%newname%" -p"%password%">nul
- exit /b 0
复制代码
|