Discussion:
convert vb script to exe
(too old to reply)
Dee
2009-04-17 15:24:01 UTC
Permalink
Hi

is there a good recommended tool to convert vb scripts to exe files?
--
Dee
Dirk Stegemann
2009-04-18 08:44:14 UTC
Permalink
Hi Dee,
Post by Dee
is there a good recommended tool to convert vb scripts to exe files?
you may possibly use vb6 to make an exe form a vbscript.

You have to use a link (in german it's called "Verweis") in the project to the windows scripting host.

I think the guys in vb6 can answer the question more detailed.

Dirk
Richard Mueller [MVP]
2009-04-18 12:59:17 UTC
Permalink
Post by Dee
Hi
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
--
Dee
2009-04-20 09:00:05 UTC
Permalink
Thanks, will lookinto VB
--
Dee
Post by Richard Mueller [MVP]
Post by Dee
Hi
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
===========
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
--
Mark D. MacLachlan
2009-07-02 21:08:41 UTC
Permalink
I realize this is an old thread, but I have another suggestion. I
purchased a program called ScriptCryptor.
http://www.abyssmedia.com/scriptcryptor/

I think it works great. It allows you to compile your VBScript code
into an EXE. Allows you to set a custom icon for it too. It was
inexpensive as well.

Another option is instantExe. http://www.instantexe.com/

Hope that helps,

Regards,

Mark D. MacLachlan

Loading...