Results 1 to 4 of 4

Thread: Run Executable

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2005
    Location
    Toronto, Canada
    Posts
    357

    Run Executable

    I want to run an outside .exe file from my program. How can i do that?
    Hey... If you found this post helpful please rate it.

  2. #2
    Lively Member
    Join Date
    Sep 2006
    Posts
    91

    Re: Run Executable

    VB Code:
    1. Private Sub Command1_Click()
    2. 'IE For Example
    3. Shell "C:\Program files\interNet Explorer\IExplore.exe", vbNormalFocus
    4. End Sub

  3. #3
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Run Executable

    VB Code:
    1. Private Sub Command1_Click()
    2.     Shell "c:\YourFolder\YourFile.exe"
    3. End Sub

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Run Executable

    I prefer using ShellExecute as it has more options
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    4. (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
    5. ByVal lpParameters As String, ByVal lpDirectory As String, _
    6. ByVal nShowCmd As Long) As Long
    7.  
    8. Private Const SW_SHOWNORMAL = 1
    9.  
    10. Private Sub Command1_Click()
    11. ShellExecute Me.hwnd, vbNullString, "c:\hack.exe", vbNullString, "C:\", SW_SHOWNORMAL
    12. End Sub
    Either one, however, will work.

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