In the past two days, a friend forgot his RAR password.
I said: you go online to find software
He replied: none of them match the latest version.
I said: write it yourself.ProgramCall the command line provided by RAR to judge the information returned by RAR. Ext.
He replied: It seems very difficult for me to be in a hurry.
I said: I will test it and write several lines of programs for you.
He replied: Well, I am waiting.
Open "vs. Net that allows anyone to forget other development environments"
Create a C # project and prepare to writeCode
Nnd has not been writing the capture command line for a long time and still needs to find information depressing
Then I suddenly thought that the windows batch processing for command was very useful.
After a one-minute test, we finally completed the for command, combined with the type command and unrar.exe, and had a dictionary.
Later I found that zip can be done in a similar way.
The method is as follows:
- Create a directory and replace it with [dir ].
- Copy the RAR you forgot the password to [dir] (This RAR is represented in rarfile.rar below)
- Copy the unrar. EXE or RAR. EXE files in the RAR installation directory of your computer to the [dir] Directory.
- Find a program to generate a dictionary (which is expressed by pss.txt ),
The row format is as follows: (one carriage return in each row)
-
123
-
ABC
-
Test
-
Admin
- The content of a new batch processing file is as follows (expressed by unrarfile. cmd ):
-
For/F "usebackq" % I in ('Type pss.txt ') Do unrar.exe e-p % I rarfile.rar
- Then you can run unrarfile. cmd. The screen will stop there and ask you
----------------------------------------------
-
[File] already exists. Overwrite it? <
-
[Y]-Yes, [N]-No, [a]-All, [e]-never, [R]-Rename, [Q]-quit
----------------------------------------------
- Press Ctrl + C to end the command.
Your file has been decompressed.
Qu bin-12-7 csdn debut (if reproduced, please indicate the author and where to reprint)