I am trying to create a self-extracting archive that extracts to "%USERPROFILE%\Desktop" with WinRar. However, when I run it, it extracts to the SFX's current directory, not my desktop. Does the path to extract option work at all?
I'm using the 32-bit command line module.
I also checked the 'hide all' box for silent mode which appears to do absolutely nothing and the command prompt window still appears with showing information on what is extracted.
I want that SFX archive extracts the .exe and the folder contained in the SFX file to the desktop without any messages popping up.
Any suggestions?
It is possible to create an SFX RAR archive extracting all files and folders directly to
"%USERPROFILE%\Desktop"
without showing a window.This can be done with WinRAR after selecting the files and folders and clicking on icon Add in the toolbar by
"%USERPROFILE%\Desktop"
which results in automatic selection of option Absolute path which is right,A command prompt window will be always displayed if module WinCon.sfx is used for the SFX archive as in this case Windows detects automatically on start of the SFX archive that this is a console application and opens a command prompt window in which the console SFX is executed.
Creating such an SFX archive can be done also with a batch file:
In this batch file must be modified for usage:
Rar.exe
and also the SFX module Default.sfx.The used switches are explained in text file Rar.txt in program files folder of WinRAR.
One more note on switch
-ep1
:Everything up to last backslash in name of folder and/or file to add to archive is removed from name on adding the folder or file to the archive.
On adding a folder to a RAR archive it makes a difference if the folder is specified with or without a backslash at end.
Example:
A directory tree like
is compressed with
with following files and folders in archive
C:\Temp\Demo1.rar
while using
or using
results in following files and folders in archive
C:\Temp\Demo2.rar