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 LongPrivate Sub Command2_Click()
    ShellExecute Me.hwnd, "Open", "aa.exe", "", App.Path, 1
End Sub

解决方案 »

  1.   

    dim a as long
    a=shell("盘符,路径,文件名") '注意用引号扩起来.
      

  2.   

    先声明两个API:
    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
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    然后:Private Sub Command1_Click()
               ShellExecute(GetDesktopWindow, "Open", "C:\FileName.exe", "", "", 1)
         End Sub
      

  3.   

    '先定义api
    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
    Private Declare Function GetDesktopWindow Lib "user32" () As Long
    '然后到你想要用的地方使用
    Private Sub listbox_Click()
              ShellExecute(GetDesktopWindow, "Open", "文件路径", "", "", 1)
        End Sub 
    ‘格式,参照有关书集
      

  4.   

    public sub cmd1_click()shell ("c:\windows\notepad.exe")'或具体路径end sub