然后在vb中引用api函数:
Private Declare Function ShellExecute Lib "shell32dll" 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()
Dim VBS As String
VBS = "C:\1vbs" ‘文件路径
ShellExecute ByVal 0, "open", VBS, ByVal 0, ByVal 0, ByVal 0
End Sub
Dim x
Set x = CreateObject("WscriptShell")
Do
xSendKeys "你要按的键" //Ctrl键用^表示。
Loop
欢迎分享,转载请注明来源:浪漫分享网
评论列表(0条)