VB如何运行VBS程序

2025-01-03 22:40:20
推荐回答(4个)
回答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", "C:\run.vbs", 0, 0, 0
End Sub

Shell函数只能运行可执行文件和批处理
shellexecute API可以运行系统中有关联的任何格式

回答2:

shell("C:\run.vbs")

回答3:

使用Shell()函数来做

回答4:

shell("C:\run.vbs")
啊.....
shell函数