批量解压多个rar压缩包并将解压出来的文件以该压缩包的名称重命名.bat
复制下面的内容保存成bat文件即可运行:
@echo off
rem 批量解压多个zip压缩包并将解压出来的文件以该压缩包的名称重命名
mode con lines=5000
set #=Any question&set @=WX
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 *.rar') 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