vb shell无法调用可执行文件

来源:百度知道 编辑:UC知道 时间:2024/09/25 09:39:26
我做了一些便捷的按钮,就是为了将一些常用的软件集中起来用着方便又不占桌面,,但是问题出来了,其他的软件都能正常运行,但是我新装的3DMAX,和acdsee两个软件怎么点击也不运行,求解。

例:shell "X:\3Dfile\3D.exe"

改用 ShellExecute 函数绝对可以..!!

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 Const SW_SHOWNORMAL = 1

Private Sub Command1_Click()
Dim pth As String
pth = "X:\3Dfile\3D.exe" '//程序路径
ShellExecute Me.hwnd, "open", pth, "", "", 1
End Sub

这么写是可以运行的,但是你的错误提示什么?
是不是你的路径之间有空格?有空格VB是不能识别的。

简单 绝对可以,加我