In the mailing list I saw people asking about how to convert VBScript file to executable file (EXE). There are so many implementation for this but I will cover the easiest way by using IExpress from Microsoft. IExpress is a technology designed to simplify creation of a setup program. Using the step-by-step IExpress Wizard, you can create self-extracting files that automatically run the setup program contained inside. The setup program can be an .inf file or an executable program. IExpress technology automatically removes the setup files after installation, saving the user time and frustration.
OK now we will explain step-by-step to convert VBScript file into EXE file.
1. Let’s assume we have a VBScript file. Now we will create the simplest VBScript file for this example.
1 | 'script name: hello.vbs |
Save it as hello.vbs
2. Test the file, please type cscript hello.vbs from command prompt. If everything OK then it will shows the pop-up window like the picture below.
3. Now create batch file that will used by IExpress during conversion from VBScript to EXE. Open new text file using Notepad and type like below.
cscript hello.vbs
Save it as hello.bat.
4. Now go to command prompt and type iexpress and it will run and will show dialog like below. I am using Windows Vista right now but no problem, you can try it on Windows XP too.
Choose ‘Create new Self Extraction Directive file’ option and click next. It will show the next dialog like below.
Choose ‘Extract files and run an installation command’ option and click next. It will show the next dialog like below.
Type the Package title, I type Hello Express there. Click next and it will show the next dialog like below.
Choose ‘No prompt’ and click next. It will show the next dialog like below.
Choose ‘Do not display a license’ and click next. It will show the next dialog like below.
Press ‘Add’ button and add the hello.vbs and hello.bat that we already created previously. Click next and it will show the next dialog like below.
On the ‘Install Program’ combobox, select ‘hello.bat’ then click next and it will show the next dialog like below.
Choose ‘Default (recommended)’ option and click next and it will show the next dialog like below.
Choose ‘No message’ and click next. It will show the next dialog like below.
You must input your target EXE file name there. Click Browse button and type your desired EXE file name. I type ‘hello’ there so it will create hello.exe file on the same folder like hello.bat and hello.vbs. Click next and the next dialog will show like below.
Choose ‘Only restart if needed’ option and click next. It will show the next dialog like below.
Just click Next button there and the next dialog will be like below.
Now is the last part of the wizard. Click next again and your EXE file will be created. If everything OK then your EXE file will be available on the same folder with hello.vbs and hello.bat. See the picture below.
Press Finish button and you are done!
0 comments:
Post a Comment