Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: writting a .bat file  (Read 5236 times)

0 Members and 1 Guest are viewing this topic.

cnvrt

  • Guest
writting a .bat file
« on: December 24, 2007, 10:57:06 PM »
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" :)

Deerpark



    Egghead
  • Thanked: 1
    Re: writting a .bat file
    « Reply #1 on: December 26, 2007, 07:01:42 AM »
    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.
    Any sufficiently advanced technology is indistinguishable from magic.
    Arthur C. Clarke (1917 - 2008)

    cnvrt

    • Guest
    Re: writting a .bat file
    « Reply #2 on: December 27, 2007, 04:36:34 AM »
    would be using winrar to unzip the files.. if thats what u meant :s

    Deerpark



      Egghead
    • Thanked: 1
      Re: writting a .bat file
      « Reply #3 on: December 27, 2007, 07:36:39 AM »
      WinRAR 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_unrar
      Any sufficiently advanced technology is indistinguishable from magic.
      Arthur C. Clarke (1917 - 2008)

      cnvrt

      • Guest
      Re: writting a .bat file
      « Reply #4 on: January 13, 2008, 07:13:11 AM »
      cheers, will try it and find out and report back :D

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

      WillyW



        Specialist
      • Thanked: 29
      • Experience: Experienced
      • OS: Windows XP
      Re: writting a .bat file
      « Reply #5 on: January 13, 2008, 12:57:16 PM »
      cheers, will try it and find out and report back :D

      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.

      .