中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-03 18:17
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » How to batch extract RAR files with the same password?
Printable Version  2,681 / 17
Floor1 zhaoxianqunks Posted 2007-03-08 14:29
初级用户 Posts 12 Credits 28

─────────────────── Moderation Record ────────────────────
Performed by: namejm
Original Title: Request for a batch command
Description: The title is too vague, which is not convenient for forum search and management. Please modify the title within three days.
Prompt: To modify the title, click Edit at the bottom right of the current post, and then click Edit Post after modification.
Punishment: Since it is a new forum user, no punishment is temporarily given; if the title is not modified after three days, 2 points will be deducted as a punishment, and the moderator will forcibly modify the title. Please click here to read the forum posting regulations to avoid violating posting regulations in future discussions.
─────────────────── Moderation Record ────────────────────

I need to extract all compressed files in a folder (for example, the d:\txe directory, which has thousands of compressed files in the directory) to a specified directory (for example, e:\temp\01). (All compressed files in the folder need to be password-protected, and the passwords are all the same.) How should this be written?

[ Last edited by zhaoxianqunks on 2007-3-10 at 12:07 AM ]
Floor2 zhoushijay Posted 2007-03-08 14:45
高级用户 Posts 375 Credits 845
echo off
cd /d "C:\Program Files\WinRAR" & winrar e e:\11\*.rar e:\22

The -p switch is only available for setting a password when adding files to a RAR archive, not for entering a password when extracting. You need to input it manually.

The above code only extracts when the RAR has no password
Floor3 zhaoxianqunks Posted 2007-03-08 14:54
初级用户 Posts 12 Credits 28
There is a fixed password. How to use it?
Floor4 zhaoxianqunks Posted 2007-03-08 14:55
初级用户 Posts 12 Credits 28
I see a post that is written like this:
for /d %%d in (%1.*.*) do "%ProgramFiles%.\WinRAR\rar" a -r -m0 -inul %1."%%~nxd.rar" "%%~nxd"
for %%f in (%1.*.*) do "%ProgramFiles%.\WinRAR\rar" a -r -m0 -inul %1."%%~nf.rar" "%%~nxf"
Floor5 test266 Posted 2007-03-08 22:18
初级用户 Posts 10 Credits 22
winrar e -ppassword a.rar c:\test\

-p is the switch to enter the password, followed by the password

[ Last edited by test266 on 2007-3-8 at 09:19 AM ]
Floor6 zhaoxianqunks Posted 2007-03-09 04:09
初级用户 Posts 12 Credits 28
For example, the password is 99999, then how should it be written? Please give a complete batch script, thank you!
Floor7 zhoushijay Posted 2007-03-10 00:03
高级用户 Posts 375 Credits 845
echo off
cd /d "C:\Program Files\WinRAR" & winrar e -p99999 e:\11\*.rar e:\22

According to what the 5th floor said,
Floor8 lxmxn Posted 2007-03-10 00:41
版主 Posts 4,938 Credits 11,386
I need to extract all compressed files in a folder to a specified directory. (All compressed files in the folder need a password, and the passwords are all the same.) How should this be written?


  "Extract all compressed files in a folder". Which folder's compressed files are we talking about?
  
  "Extract to a specified directory". Which directory exactly?

  "The passwords are all the same". What is the password?

  Don't you expect the person writing code to help you assume which folder's compressed files they are? Others would have to assume the folder, assume an extraction directory, and assume a password. Would others spend a lot of time assuming for you? Take a close look here: http://www.cn-dos.net/forum/viewthread.php?tid=1415&fpage=1
Floor9 zhaoxianqunks Posted 2007-03-10 10:52
初级用户 Posts 12 Credits 28
Administrator, I'm new here. I don't know if I meet the requirements now. Is it because of my expression ability? If it's still not okay, please delete it. Thank you.
Floor10 electronixtar Posted 2007-03-10 10:56
铂金会员 Posts 2,672 Credits 7,493
Personal suggestion: The title is:

How to batch extract RAR files with the same password?

My title is more informative than the information upstairs of yours?
Floor11 lxmxn Posted 2007-03-10 12:54
版主 Posts 4,938 Credits 11,386


  Not tested, try this, post if there are issues.

  Also, please note that future posts should have titles indicating the general content. Change the title to what brother electronixtar mentioned above.

Floor12 zhaoxianqunks Posted 2007-03-10 13:06
初级用户 Posts 12 Credits 28
Thanks to the person above. I don't know if there's a problem with my modification. The test prompt on the 7th floor said that the compressed file wasn't found. I'll post the actually modified code:
echo off
cd /d "C:\Program Files\WinRAR" & winrar e -ptxtdown.com F:\小说\111111\txtdown.com\*.rar F:\小说\111111\txtdown.com
Note: The actual path on my hard drive is: F:\小说\111111\txtdown.com (There are about 7,000 compressed files in the folder named txtdown.com, and the extraction password is: txtdown.com)
The prompt on the 11th floor isn't the correct command. The modification is as follows:
@echo off
for /r F:\小说\111111\txtdown.com %%a in (*.rar *.zip) do (rar x -ptxtdown.com "%%a" F:\小说\111111\txtdown.com")
Everyone, help me see where the error is? Thanks

[ Last edited by zhaoxianqunks on 2007-3-10 at 12:27 AM ]
Floor13 lxmxn Posted 2007-03-10 13:28
版主 Posts 4,938 Credits 11,386

  Re zhaoxianqunks:

  Please post your code for us to see.
Floor14 zhaoxianqunks Posted 2007-03-10 13:42
初级用户 Posts 12 Credits 28
@echo off
for /r F:\小说\111111\txtdown.com %%a in (*.rar *.zip) do (rar x -ptxtdown.com "%%a" F:\小说\111111\txtdown.com")

My QQ:290260605 After correct processing, I will post it.

[ Last edited by zhaoxianqunks on 2007-3-10 at 12:45 AM ]
Floor15 lxmxn Posted 2007-03-10 13:55
版主 Posts 4,938 Credits 11,386

  Re zhaoxianqunks:

  What specific error is it? It's best to take a screenshot and show it.
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023