Results 1 to 2 of 2

Thread: Launching an EXE from within an EXE

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Posts
    6

    Post

    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


  2. #2
    Guest

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width