Results 1 to 4 of 4

Thread: please help

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    49
    How can i call a exe file in visual basic, to execute it.

  2. #2
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    Talking

    Dim r As Long

    lblCurrentPath.Caption = lblCurrentPath.Caption + "\" + cboSelection.Text
    r = StartDoc(lblCurrentPath.Caption)
    212 will lead you to the truth

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Location
    Dallas, TX
    Posts
    89
    Dim RetVal as Long

    RetVal = Shell("C:\MyDirectory\My.exe", vbNormalFocus)
    ande211
    VB6 SP3

  4. #4
    Guest
    It is best to use the ShellExecute api function. This is good because it will load any program no matter what. Whereas the regular Shell function may cause an error if it cannot load the file or if it doesn't exist.

    Code:
    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
    
    Public Const SW_SHOWNORMAL = 1
    
    ShellExecute Me.hwnd, vbNullString, "C:\file.exe", vbNullString, "c:\", SW_SHOWNORMAL

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