Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create WinRAR, RAR file via command line with a certain profile

I'm referring to the profiles visible in the GUI version of the application. Can these be accessed via command line? I'm trying to create a RAR file via scheduled batch script. Thank you very much. enter image description here

like image 858
Slbox Avatar asked Nov 25 '25 09:11

Slbox


1 Answers

As per documentation provided in WinRAR manual use -cp <name> switch to select compression profile.

Here is a cite from the documentation:

Using this switch you can load settings stored in WinRAR compression profile. You need to specify a profile name as switch parameter. If profile stores selected file names, WinRAR will compress both files specified in the command line and stored in profile. If profile contains an archive name, it will be used in archiving and you should not specify another archive name in command line.

Archive *.txt files using settings from "My Texts" compression profile by using:

WinRAR a "-cpMy Texts" texts *.txt
like image 114
miradham Avatar answered Nov 28 '25 02:11

miradham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!