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.
source share