# 好像不能

Posted by Windows NT user on February 01, 1999 at 09:07:46:

In Reply to: Re: 请问，如何呼叫某执行档来执行该档的档案类型 posted by 纪文和 on January 25, 1999 at 18:00:25:

:
: shell "start 含路径之档名"

: 例: shell "start c:\test.txt"

: 会自动依据关联启动相关档案

我试过,但只会产生ERROR 53

我有一个方法,就是用API

Option Explicit

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 Sub Command1_Click()
ShellExecute 0, vbNullString, "g:\mp3\25.mp3", "", "", vbNormalFocus
End Sub

Follow Ups: