1) Install 7-zip (7zs.sfx'll be installed to C:\Program Files\7-zip):
http://7zsfx.solta.ru/en/
2) Copy following script snippet to Notepad and save as Config.txt with UTF-8 encouding by selecting File -- Save as ... Switch Encoding to "UTF-8"
; [Email protected]@! utf-8! Cancelprompt= "is sure you want to cancel?" Finishmessage= "Hi, file has been successfully extracted! "Guiflags=" 8+128 "installpath="%programfiles%\\myfolder\\contain Space "extractpathtext=" Please select extraction Path: "extractpathtitle=" Welcome to use 7zip self-extracting archive "extractcanceltext=" Abort "; [Email protected]@!
3) Make a folder for placing the file (s) of you expect to extract.
4) Select All and right-click on any one of the them, select "Add to archive ...", Change archive name, set Compressio n level to Ultra, click OK
5) Copy 7zs.sfx and Config.txt to the same folder
6) Open a command line, CD-to-this-folder (Or, press SHIFT [do-not-let-go] and right-click in the blanks inside T His folder, select Open Command Windowhere)
Enter following command line
Copy/b 7zs.sfx + config.txt + archivename.7z Self-extract-executable-name.exe
Reference:
Http://sevenzip.sourceforge.jp/chm/cmdline/switches/sfx.htm
http://www.msfn.org/board/topic/99843-7-zip-sfx-extract-to-this-folder/
http://sourceforge.net/p/sevenzip/discussion/45797/thread/31dc880f
7zip self-extracted executable:to extract file to specific directory