How to Use DotNetWrapper.vbs
To use DotNetWrapper.vbs, you must have Windows Script Host (WSH) 5.6 and .NET Framework 1.1 or later installed on the machine on which you plan to run it. To determine which version of the .NET Framework you have on your machine, you can look in the %systemroot%\Microsoft.NET\ Framework folder. Each version of the .NET Framework appears in a subfolder. I wrote the script to work with version 1.1.4322. If you have a later version, you need to change the information on the following line in DotNetWrapper.vbs to match your version:
dotNetVersion = "v1.1.4322"
Another change you might need to make concerns the code
System.Threading.Thread.Sleep
(1000)
This code, which inserts a 1-second pause, is used twice in DotNetWrapper.vbs. The first pause occurs between the closing of the temporary file and the execution of the script. The second pause occurs between the execution of the script and the deletion of the script. It might be necessary (although unlikely) to increase the length of the pauses based on the size of the script you're protecting. A 1-second pause works fine for the largest scripts (about 500 lines, or 14KB) I run with DotNetWrapper.vbs. If you do need to change it, simply change the 1000 value to, say, 2000, which would create a 2-second pause. . . .
compiling an hta file has a drawback in that when it launches, the console window stays open with the hta file until the hta file is closed
be nice to know how to close the console window
webber123456 August 21, 2006 (Article Rating: