1.

Solve : writting a .bat file?

Answer»

is there anyway to make a .BAT folder that will open up a rar file for me and enter the password for me and i can store it on a USB drive for security reasons?

Any help would be greatly appreciated

p.s OS is windows XP pro "service pack 2" What program are you going to use to unpack the rar file?

If the program supports unpacking password protected files via command line then yes.
would be using winrar to unzip the files.. if thats what u meant :sWinRAR should come with two command line utilities you can use.
Rar.exe for creating RAR archives and Unrar.exe for unpacking them.
These should be placed in the WinRAR program folder.
I don't use WinRAR personally and I have only been able to find a basic example on what commands to use in order to unrar a file. I suggest you check the documentation for WinRAR to find out whether unrar.exe supports unpacking a password protected file. I would think it does support it though.
Also try typing unrar -? at the command line (or unrar /?) this will usually give you a LIST of available parameters.
Here is the basic unpacking example:
http://www.respower.com/page_tutorial_unrarcheers, will try it and find out and report back

hmm, i dunno how to work this, can someone show me how :s Quote from: cnvrt on January 13, 2008, 07:13:11 AM

cheers, will try it and find out and report back

hmm, i dunno how to work this, can someone show me how :s

Assuming that you have Winrar installed in C:\Program Files\winrar
and that rar.exe exists in that folder :

Code: [Select]@echo off
"c:\program files\winrar\rar" e -p temprar.rar

The e is the command that tells rar.exe to extract to the current DIRECTORY.

The -p is the switch that tells rar.exe to ask for a password
temprar.rar is the filename to unpack.



A little bit different:

Code: [Select]@echo off
"c:\program files\winrar\rar" e -ppassword temprar.rar d:\temp\testdir

This way, it won't ask you for a password. It uses the text immediately following the -p as the password.

This way, it does not extract to the current directory. It extracts to
d:\temp\testdir. This assumes that d:\temp\testdir already exists.
If it does not, it will not create it, nor will it extract the files.


To get all the command line options, switches, and basic syntax, you can get
rar.exe to display it.
Open a command prompt window.

Navigate to the directory that contains rar.exe, which we are assuming is
c:\program files\winrar with:
c: and hit enter.
then:
cd\"program files\winrar" and hit enter.

TYPE dir *.exe and hit enter.
If you see rar.exe listed, you are in the right directory.
If so, now type rar /? and hit enter
If it runs off the page, then use rar /? |more and hit enter.
This is exactly where I got the commands and switches that I've mentioned above.

I hope this helps.



Discussion

No Comment Found