|
-
May 16th, 2000, 12:10 PM
#3
Lively Member
When using Shell it will execute the file in the current directory unless specified. As far as I know, so don't add the path to the filename you execute and you should be fine... See code below
Private Sub CmdRun_Click()
Dim AppName as String
Dim AppProcID as Integer
AppName = "MyApp.exe"
On Error Goto ErrRoutine
AppProcID = Shell(AppName)
Exit Sub
ErrRoutine:
'exe wasn't found or some internal error occured
'you can either, log it to a file, message box it or
'ignore it. if you run this code from the VB IDE without
'making this app an .exe Shell command will assume MyApp.exe
'is in the current dir for VB. example: c:\program files\DevStudio\VisualBasic\MyApp.exe
End Sub
Regards,
 Paul Rivoli 
---------------------
[email protected]
http://members.dingoblue.net.au/~privoli
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|