How do I set SFX option when creating one from the command line?

5.1k Views Asked by At

Here is my batch file command:

set rar_path=C:\Program Files\WinRAR
"%rar_path%\rar" a -sfx "MyArchive" Folder1 Folder2 File1.exe File2.exe

How do I set the sfx creation options? Specifically I want the self-executable to auto-run a file after it is finished extraction it to a set location.

2

There are 2 best solutions below

0
On BEST ANSWER

Found it:

set rar_path=C:\Program Files\WinRAR
"%rar_path%\rar" a -sfx -z"YOUR CONFIG FILE.conf" "MyArchive" Folder1 Folder2 File1.exe File2.exe

And here is the CONFIG file:

Silent=1
Overwrite=1
Path=FOLDER NAME IN PROGRAM FOLDER
Setup=FILE TO RUN AFTER IT FINISH.EXE
0
On

with the script on answer 1 with the Config file do you have to make that before you compress and where do you put it if you have to make before compressing