convert vb script to exe

Discussion in 'Scripting' started by Dee, Apr 17, 2009.

  1. Dee

    Dee Guest

    Hi

    is there a good recommended tool to convert vb scripts to exe files?
     
    Dee, Apr 17, 2009
    #1
    1. Advertisements

  2. Hi Dee,

    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
     
    Dirk Stegemann, Apr 18, 2009
    #2
    1. Advertisements

  3. 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], Apr 18, 2009
    #3
  4. Dee

    Dee Guest

    Thanks, will lookinto VB
    --
    Dee


     
    Dee, Apr 20, 2009
    #4
  5. 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
     
    Mark D. MacLachlan, Jul 2, 2009
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.