Post by DeeHi
is there a good recommended tool to convert vb scripts to exe files?
--
Since classic VB and VBScript are so similar, VB is a good choice. I don't
know of any programs to automatically convert, but many VBScript programs
can be manually converted into classic VB (not .NET). You need VB (or
classic Visual Studio) installed.
The main difference is that VB does not have a Wscript object, so you cannot
use Wscript.Sleep, Wscript.Echo, and Wscript.Quit. Use Call MsgBox in place
of Wscript.Echo. Use End in place of Wscript.Quit. You can use a Timer
control in place of Wscript.Sleep.
If you use Scripting.Dictionary or Scripting.FileSystemObject then you
should add a reference to "Microsoft Scripting Runtime", which is
scrrun.dll, to the project.
If you want a form with an OK button to launch your code, open the VB IDE,
create a standard exe, add two CommandButtons to the form and rename them
"OK" and "Exit", then go to the code view and enter the following:
===========
Private Sub End_Click
End
End Sub
Private Sub OK_Click
' Paste your VBScript program here.
End Sub
=========
Then make the project and you have an exe that runs your VBScript program
when you click "OK". You click "Exit" to quit the program. If you don't want
a form, add a Module to your project and remove the form. Then paste your
VBScript code into a Sub Main in the module and build the exe. The exe runs
your program without a GUI, unless you have Call MsgBox or InputBox or other
VBScript GUI functions in the code.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--