WinRAR Command Line Extraction and Replace

10,784

I found this website with a commands overview, hope it helps. See the x page for help on extracting.

Update: According to this SO question the options should be -o+

This info should all be in the help file provided with your WinRAR installation. Open the help, look for "Command line mode" and then the sub-topics "Commands" and "Switches".

Update: should look like this:

WinRAR x -o+ texts.zip *.txt C:\texts\
Share:
10,784

Related videos on Youtube

NCSGeek
Author by

NCSGeek

Updated on September 18, 2022

Comments

  • NCSGeek
    NCSGeek over 1 year

    I need to figure out how to use the WinRAR command line in order to extract a zip file into a specific directory, and replace any files that are already there. (tl;dr is I need to extract and replace via winrar commandline)

    So if I had a texts.zip file that contained 1.txt 2.txt 3.txt and I also had C:\texts\ which contained random-junk.pdf more-junk.png 1.txt 2.txt 3.txt, I need my batch file to extract texts.zip into C:\texts\ and for it to leave the the pdf and png alone (these are just examples) but replace the txt files which are meant to represent an already existing file, with the new ones from the zip.

    Any help is very apreciated, thank you all!

  • NCSGeek
    NCSGeek over 6 years
    Thank you, Though that first page helped, I still do not fully understand how I need to format my command. Pardon my inept-ness at this.
  • pritaeas
    pritaeas over 6 years
    Updated with example.
  • NCSGeek
    NCSGeek over 6 years
    I see. The example looks to only affect .txt files. In my case, I need to extract & replace many different files, and directories. Any solution?
  • pritaeas
    pritaeas over 6 years
    Yes. It should be possible to replace *.txt with a filename (e.g. @listfile.txt) containing all the extensions or masks you want processed. I have not used this before, so you'll need to try yourself.