[RESOLVED] How do you on a command click shell and run a .vbs file?
I tried
gf Code:
Dim ReturnValue
ReturnValue = Shell("C:\Documents and Settings\Administrator\Desktop\dial2.VBS", 1) ' Run Calculator.
AppActivate ReturnValue
and this to
f Code:
Shell("C:\Documents and Settings\Administrator\Desktop\dial2.VBS")
and this
h Code:
Shell "C:\Documents and Settings\Administrator\Desktop\dial2.VBS"
Re: How do you on a command click shell and run a .vbs file?
Use ShellExecute.
Code:
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
Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, "C:\Documents and Settings\Administrator\Desktop\dial2.VBS", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Re: How do you on a command click shell and run a .vbs file?
Thank you!!! that works great!!!:)
Quote:
Originally Posted by zynder
Use ShellExecute.
Code:
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
Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, vbNullString, "C:\Documents and Settings\Administrator\Desktop\dial2.VBS", vbNullString, "C:\", SW_SHOWNORMAL
End Sub
Re: [RESOLVED] How do you on a command click shell and run a .vbs file?