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

Last updated on August 25, 2020 by , Posted to developer tools

vbscript compiler

Visual Basic Script is a 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 ever thought about creating an executable file from your VBScript code? The VBScript compiler makes it extremely difficult to study, analyze, reuse, and re-engineer EXE files for competitors or clients while retaining the full functionality of the original code.

You may have seen a lot of free converters, but don't be fooled - they just extract the script to a temporary directory and run it via wscript.exe or cscript.exe. You can do this yourself by creating a self-extracting archive with your script. Even an inexperienced user can bypass this protection.

This tutorial will give you step by step instructions 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, etc. With ScriptCryptor, you can embed these files directly into the executable. Before executing the main script, these files are extracted to a temporary folder, and then you can access them from the script. The files are automatically deleted after the main script is executed.

Related Articles