Hello Guest it is May 28, 2023, 12:16:13 AM

Author Topic: Launch app from a button  (Read 2775 times)

0 Members and 1 Guest are viewing this topic.

Launch app from a button
« on: January 29, 2010, 11:35:52 AM »
I'm trying launch an external app from a button using VBScript.  the following code is supposed to work but doesn't on a Mach screen.  Can anyone point me in the right direction?  Perhaps there is another way to launch an app from within Mach using a button or menu item?

Dim commandLine, WshShell
   commandLine = "C:\app.exe"
   Set WshShell = Server.CreateObject("WScript.Shell")   ' I get object not supported error on this line.
   Call WshShell.Run (commandLine,8,true)
   Set WshShell=Nothing

Re: Launch app from a button
« Reply #1 on: January 29, 2010, 12:13:15 PM »
Here's a code fragment I use for launching acrobat reader to open a doc file:

Option Explicit
' code to open the pdf User manual

Dim CmdString As String

Const Filename = "C:\Mach3\Documentation\machStdMill\MachStdMill User Manual.pdf"
Const AppFQFN = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRD32.exe"

CmdString = """" & APPFQFN & """" & " " & """" & FileName & """"

Author of the MachStdMill Extensions for Mach3