用API函数,ShellExecute 或 ShellExecuteEx 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 LongThe ShellExecute function opens or prints a specified file. The file can be an executable file or a document file. Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As LongThe ShellExecuteEx function performs an action on a file. The file can be an executable file or a document.
或
aaa=shell("start.exe c:\abc.mp3")
Declare Function ShellExecuteEx Lib "shell32.dll" Alias "ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As LongThe ShellExecuteEx function performs an action on a file. The file can be an executable file or a document.
Dim Thestring, ThisString
Thestring = TextBox1.Text
ThisString = "c:\windows\explorer.exe "
Shell ThisString & Thestring
对于一般有关联的文件都会自动启用相应的程序,不过media文件explorer.exe会自己就管起来了,呵呵:)