oggieone
Posts: 4
Joined: Sun Dec 16, 2007 3:18 am

VB Script Error.

Can someone please help me with this VB script please?
I am trying to run it as a custom action.

'************************************************
Option Explicit

Dim WshShell

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "InstallMySQL.bat", 0, True


'*** End

It doesn't work from in the installer but works outside of the installer.
Can someone please tell me what I am doing wrong?

Thanks!
Quadiago
Posts: 71
Joined: Thu May 31, 2007 9:07 am

Why not simply use a "Launch File..." custom action to run the .bat file?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Note that the installer runs script Custom Actions directly and does not use the Windows Script Host. Therefore, the WScript object cannot be used inside a script Custom Action because this object is provided by the Windows Script Host.

Please try this:

Code: Select all

Option Explicit
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "InstallMySQL.bat", 0, True
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”