如何用VB打开任意扩展名文件?不要用shell这个,只能打开exe
要求:既能打开exe也能打开音乐图片压缩文件等

解决方案 »

  1.   

    ShellExecute(GetDesktopWindow(), "open","文件路径","","",SW_SHOWNORMAL
      

  2.   

    call shell("cmd /c start 文件路径")
      

  3.   


    ShellExecute(GetDesktopWindow(),"open","文件路径","","",SW_SHOWNORMAL)
    '不要忘记先声明:
    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 
      

  4.   

    应该是:让文件被Windows打开。