'用ShellExecute,这是个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
'hwnd:你先别管这是个什么东东,就写上0
'lpOperation:也先别写,写上"open",即打开
'lpFIle:就写上你的txt文件名,如"C:\cmd.txt"
'lpparameters:不用管,写个""
'lpDerectory:不用管,写个""
'nShowcmd,不用管,写个1
'整个函数其实你要写的就是有一个文件名,其他的基本可以算是固定的
要打开某个文件只要这样:
ShellExecute 0,"OPEN","你的文件名(要用双引号哦!)","","",1