-
Hi there!
I am in my program CAM.exe and at a certain point want to run CopyCAM.exe and close CAM.exe. But I don't know how to launch an .exe from within another .exe. Does it have to be with using a Shell function? I looked in MSDN but only found examples in "C" not VB.
I'm using VB 6 and Windows NT.
Thank you for your help!!
Andrea
:)
-
Code:
'try the shellexecute funcion
'Declaration is:
Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _ lpOperation As String, ByVal lpFile As String, ByVal _ lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
'one use would be :
Dim MyLauch As String
MyLauch = ShellExecute(0&, vbNullString, "C:\MyFile.txt", _ vbNullString, App.path, SW_SHOWNORMAL)
'have fun