0

I want to create an exe file which includes mysql.msi and java.zip. I have written vbscript to install mysql and extract java file in C: drive. It works fine.

Now my problem is:

Convert the source folder as exe by using WinRAR sfx option.

How can I execute the vbscript or bat file (for executing vbscript) when I click the created exe?

Has anybody a solution?

Mofi
  • 46,139
  • 17
  • 80
  • 143
Dhinakar
  • 4,061
  • 6
  • 36
  • 68

1 Answers1

2

SFX commands: Setup i.e., Setup = <program>

SFX will try to execute after successful extraction. The folder containing extracted files is set as the current before executing . If a program name contains spaces, it must be enclosed in quotes.

Example

Setup = setup.exe

  • 1
    follow this link : http://www.jackmccarthy.com/malware/WinRAR_Archive_Creation.htm –  Sep 28 '12 at 20:06
  • does this work for non-executable stuff? e.g. will Setup=home.html open the file in default browser? – tumchaaditya May 20 '13 at 07:15
  • @tumchaaditya Right now, I don't have access to windows machine(I'm on my Linux machine), why don't you try it yourself .. sorry for being not so helpful .. Have a Good day! –  May 21 '13 at 04:49
  • @tumchaaditya For getting opened a file not being an executable by the application registered as default application for the file according to file extension create a batch file with first line being `start "" "File To Open"` and second line being `del "%~f0"` and add this batch file to the archive and specify this batch file as executable to run after extraction. The batch file opens the file in default application (browser for *.htm) using command __start__ and then deletes itself. – Mofi Sep 23 '15 at 05:57