Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 08:07:18 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Launch app from a button
Pages: 1   Go Down
Print
Author Topic: Launch app from a button  (Read 473 times)
0 Members and 2 Guests are viewing this topic.
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« 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
Logged
DaveCVI
V4 Screen Contributor

Offline Offline

Posts: 532



View Profile WWW
« 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
Logged

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!