By their very nature, scripts are open to the world. Anyone can see the code in a text editor. So, if you distribute your scripts, you need to protect them. Although you can use traditional approaches to protect your scripts such as encoding or using file- or folder-level security, there's a better way. You can use DotNetWrapper.vbs. This tool not only encodes a script but also compiles the script into an executable. You don't need to rewrite any code in your script.

DotNetWrapper.vbs works with a wide variety of scripts, including .vbs, .js, .hta, .bat, .cmd, and .htm scripts. Because it uses the Visual Basic .NET command-line compiler (vbc.exe), you need to use DotNetWrapper.vbs on a machine on which Microsoft .NET Framework 1.1 or later is installed.

In "Make Sure Your Scripts Have Some Protection," Jason Joy explains how DotNetWrapper.vbs works and how to use it. I've opened up this article for public viewing so that you can read about and download this useful tool. The article will be open for public viewing only through July 22, so don't delay. If you enjoy reading this article, you can get more of this type of content by subscribing to Scripting Pro VIP.