|
-
Oct 20th, 2007, 11:51 AM
#1
Thread Starter
Fanatic Member
[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"
Live life to the fullest!!
-
Oct 20th, 2007, 11:58 AM
#2
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
-
Oct 20th, 2007, 12:08 PM
#3
Thread Starter
Fanatic Member
Re: How do you on a command click shell and run a .vbs file?
Thank you!!! that works great!!!
 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
Live life to the fullest!!
-
Oct 20th, 2007, 12:13 PM
#4
Re: [RESOLVED] How do you on a command click shell and run a .vbs file?
No problem buddy.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|