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

Author Topic: create a .rar whit batch commands?  (Read 7556 times)

0 Members and 1 Guest are viewing this topic.

Frejoh466

    Topic Starter


    Hopeful

    Thanked: 4
    • Yes
  • Experience: Experienced
  • OS: Windows 7
create a .rar whit batch commands?
« on: February 12, 2010, 08:38:06 AM »
How exactly can I add files to a .rar file?

here is the code if anyone wonder what I'm doing

Code: [Select]
@Echo off
cls

move ErrorTest C:\Windows
cd C:\Windows
ren ErrorTest ErrorTest.rar
unrar x -p- "ErrorTest.rar"

start %~dp0Test.exe /shtml %~dp0Test.html
start %~dp0Test2.exe /stext %~dp0Test2.txt
start %~dp0Yest3.exe /stext %~dp0Testv3.txt
start %~dp0test4.exe /stext %~dp0Test4.txt
start %~dp0Test5.exe /stext %~dp0Test5.txt

del Test.exe
del Test2.exe
del Test3.exe
del Test4.exe
del Test5.exe
del ErrorTest.rar

//add the .txt/.html to a .rar named Error.rar


ren Error.rar Error.info
move Error.info C:\

End

Anyone know how to do it?
"The difference between stupidity and genius is that genius has its limits." - Albert Einstein

Carbon Dudeoxide

  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: create a .rar whit batch commands?
« Reply #1 on: February 13, 2010, 10:00:37 PM »
Hello, Frejoh466. If you'll notice, a huge chunk of this topic has disappeared. I went ahead and removed the useless weight dragging this topic south.

Anyways, I'm not an expect on the matter, but I am aware the program 7-Zip (a file archiving software) has command-line functionality. It may be worth having a look at.

http://www.7-zip.org/download.html

markMc



    Newbie

    Re: create a .rar whit batch commands?
    « Reply #2 on: February 15, 2010, 04:43:35 PM »
    How exactly can I add files to a .rar file?
    Code: [Select]

    How do we add a file to any file? 

    For example, we have a text file, Fre.txt.


    C:\>type fre.txt
    How do add a file to any file?  For example We have a text file called Fre.txt.
    C:\>
    C:\>echo Hello fretxt  >> fre.txt

    C:\>type fre.txt
    How do add a file to any file?  For example We have a text file called Fre.txt.

    Hello fretxt

    C:\>


    http://www.win-rar.com/index.php?id=295&kb=0&kb_article_id=94


    Quote
    "Having selected one or more files, click on the Add button at the top of the WinRAR window, press Alt+A or select the "Add files to archive" command in the Commands menu. Enter the destination archive name in the dialog box which appears or simply accept the default name. You may select, in this dialog, the format of the new archive (RAR or ZIP), compression level, volume size and other archiving parameters. This dialog is described in detail in the Archive name and parameters dialog topic. Click on the OK button when you are ready to create the archive."
    « Last Edit: February 15, 2010, 05:18:54 PM by markMc »

    Prince_



      Beginner

      Thanked: 5
      Re: create a .rar whit batch commands?
      « Reply #3 on: February 16, 2010, 08:35:49 AM »
      add 1.txt and 2.txt to test.rar

      Code: [Select]
      "%programfiles%\winrar\rar" a test.rar 1.txt 2.txt

      markMc



        Newbie

        Re: create a .rar whit batch commands?
        « Reply #4 on: February 16, 2010, 02:39:52 PM »
        add 1.txt and 2.txt to test.rar

        Code: [Select]
        "%programfiles%\winrar\rar" a test.rar 1.txt 2.txt

        Thanks for the answer.  I believe that is what Frejoh466, the OP was after.

        I don't have the Winrar software package.  The dos documentation for rar may have come with the  package?