Results 1 to 4 of 4

Thread: Run another program

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    4
    Is it possiable to run another VB program from within vb.

    I want it so when a button is clicked to run another vb.exe on (c:\winnt\userid.exe)

    Thanks

  2. #2
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Place this in the click event of the command button.

    call Shell(c:\winnt\userid.exe,3)

    "3" stands for maximize.
    Chemically Formulated As:
    Dr. Nitro

  3. #3
    Guest
    Look in your VB help file under "Shell Constants" and "Shell Function".

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Thumbs up ShellExecute API

    I always prefer to use the ShellExecute API function.

    Code:
    Private 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
    Const SW_SHOWNORMAL = 1
    
    Private Sub Form_Load()
        ShellExecute Me.hwnd, vbNullString, "c:\winnt\userid.exe", vbNullString, "C:\", SW_SHOWNORMAL
    End Sub

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