Board logo

标题: [文件操作] 批处理如何批量将带密码的压缩包文件分别解压到各自所在的文件夹里? [打印本页]

作者: sevenplus    时间: 2017-3-28 20:11     标题: 批处理如何批量将带密码的压缩包文件分别解压到各自所在的文件夹里?

新手求助,关于winrar有密码文件批处理的问题。
目前有大量的有密码压缩文件需要解压到当前文件夹,但是压缩文件分散在不同的子文件夹里面。
下面是在论坛里找的代码,但是不知道怎么增加自动输密码的功能。另外请问一下还有什么更好的编写方法吗?谢谢!
  1. @echo off
  2. set "path=%path%;C:\software\WinRAR"
  3. for /f "delims=" %%i in ('dir /b /s /a-d *.rar') do (
  4.     pushd "%%~dpi"
  5.     rar x "%%i"
  6. )
  7. pause
复制代码

作者: happy886rr    时间: 2017-3-28 20:41

回复 1# sevenplus
修改下7z源码,自己编译就能批量解密。
作者: pcl_test    时间: 2017-3-28 20:47

http://www.bathome.net/search.ph ... p;searchsubmit=true
作者: ShowCode    时间: 2017-3-28 21:08

@echo off
set "path=%path%;C:\software\WinRAR"
for /f "delims=" %%i in ('dir /b /s /a-d *.rar') do (
    pushd "%%~dpi"
    rar x -p你的密码 "%%i"
)
pause
作者: sevenplus    时间: 2017-3-29 00:36

回复 4# ShowCode


   谢谢啦,可以用。




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2