Option Explicit
Private Const SW_SHOWNORMAL = 1
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, "open", "notepad.exe", "D:\1.exe", 0, SW_SHOWNORMAL
End Sub
话说LZ,我们又见面了。有什么不明白的问我。
追问好长~不是有那个APP.PATH么 不过格式忘记了
追答这是调用的API,指定用notepad.exe(记事本)打开D盘下的1.exe文件。
App.path是获取程序自身的路径。难道你想用记事本打开自身?