Hello Guest it is January 27, 2020, 08:19:47 AM

Author Topic: Launch app from a button  (Read 2158 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


Thanks
Re: Launch app from a button
« Reply #1 on: January 29, 2010, 12:13:15 PM »
HI,
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 & """"
Shell(CmdString) 

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com