How to extract self-extracting exe from command line

Is there a way to extract a self-extracting exe from the command line in windows?

I have a self-extracting exe that is of type RAR. I want to extract the contents of this RAR only using windows and not use any other tools (like 7zip, Unrar, etc.) that help to extract. In addition, I want to do this only from the command line.

Are there any utilities in Windows that I can use to extract a self-extracting exe file from the command line?

+4
source share
4 answers

You might want to get a self-extracting RAR archive to do what you want with one or more of the following RAR SFX (self-extracting archive) options:

Self-extracting GUI modules support the following command line switches:

-d<path> set the destination path -p<pwd> specify a password -s silent mode, hide all -s1 same as -s -s2 silent mode, hide start dialog -sp<par> specify parameters for setup program 

I'm not sure if any of these options will prevent the installer that SFX will configure to run to run.

+14
source

Download UnRar for windows (freeware) from this link . This in itself is a self-extracting archive, which upon installation will give you the actual unrar.exe file. Then you can use unrar.exe to extract the files from the command line.

+5
source

For others who are looking for the answer to this question.

Download the trial version or purchase WinRAR. Right-click the files you want to pack and select Add to Archive.

Check "create sfx archive" on the "General" tab, this will give you the .exe file

Select "sfx Options" on the "Advanced" tab, on the "Modes" tab, select "Hide All". If you do not want the extracted files to appear or remain after starting your program / script, then "Unzip to temporary folder" on the same tab.

On the "Installation" tab in the "Run after extraction", put the program or script that you want to run.

After the files have been packaged, you will receive the file.exe file. (Note: The file will be what you called the sfx archive). From the command line, enter file.exe and it will be extracted to a temporary location (if you selected this) and run the program / script you specified. After closing the program / script, the folder in the temporary location will be deleted.

Notes:

If starting from the WinPe CD-ROM or other similar bootable media is not used, use "Unzip to temporary folder".

WinRAR should only be on the computer creating the sfx archive. Once the sfx archive is created, you do not need to extract the files.

0
source

Use the unzip utility from http://www.info-zip.org/ . It is open source and binaries are available for all os flavors.

unzip command: unzip.exe sample.zip -d extract_folder

Download the latest executables at ftp://ftp.info-zip.org/pub/infozip/win32/ . After downloading a binary file such as "unz552xn-x64.exe", run it on the command line, it will provide a set of files, including unzip.exe. since unzip.exe has no dependency, other files may be deleted.

0
source

Source: https://habr.com/ru/post/1395416/


All Articles