VB怎样打开exe和lnk?

2024-12-01 11:23:29
推荐回答(4个)
回答1:

注意:
文件路径有空格的要用""括起来,如下面的:

shell "cmd.exe /c start "+ Chr(34) + Chr(34) + " " + Chr(34) +"你文件路径"+chr(34),vbhide

就可以了,所有文件都可以!! (chr(34)是VB里面"的意思)

[汗..太急了,现在可以了,我忘了start的参数了,现在绝对可以了.]

shell "cmd.exe /c start "+ Chr(34) + Chr(34) + " " + Chr(34) +"你文件路径"+chr(34),vbhide

回答2:

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

ShellExecute Me.hwnd, str_null,"快捷方式绝对路径", str_null, str_null, 1

回答3:

能打开的。

回答4:

用 Win32API

shellexecute 函数