How to create Windows executable (.exe) from VBS script

Last updated on June 5, 2017 by

Visual Basic Script is very popular and powerful language for Windows administrators. Easy access to COM objects makes it suitable for developing full fledged applications for Windows. But what about secure distribution of your scripts? Do you need to hide the algorithms, logins and passwords? You will need some kind of VBScript obfuscator for this. Have you thought of creating an executable file from the VBScript? VBScript compiler makes EXE files extremely difficult to study, analyse, reuse and re-work for competitors or customers, while retaining the full functionality of the original code.

Perhaps you've seen a lot of free converters, but do not let yourself be deceived - they just unpack the script into a temporary directory and execute it through the wscript.exe or cscript.exe. You can do this yourself, creating a self-extracting archive with your script. Even an inexperienced user can circumvent such protection.

This tutorial will give you step by step instruction on how to create native x86 or x64 executable from VBS script. You will need a vbs to exe compiler - ScriptCryptor. By the way, ScriptCryptor can compile JavaScript to EXE just as well.

vbs to exe compiler screenshot
  1. Run the ScriptCryptor
  2. Create a new VBS script or open an existing script from the hard disk. At this point, you do not need any changes to the script code, because ScriptCryptor will emulate the WScript system object.
  3. Select project type: console or windowed
  4. Optional: assign Version Info for executable
  5. Optional: assign application icon
  6. If your script required administrator privileges then you can embed Administrator manifest into executable.
  7. Click the "Build" button to create EXE file

In some cases, you may need to distribute additional files with your script. Something like a help file, a license agreement, e.t.c. With ScriptCryptor, you can embed these files directly into the executable. Before executing the main script, these files will be extracted to a temporary folder, and then you can access them from the script. The files will be deleted automatically after the main script is executed.

Rating: 4.27 / 5 (based on 45 votes)