我要写个VB程序,需要通过此程序运行指定路径的A.EXE 需要怎么运行呢?代码如何写?
我本想用shell/c来实现可是不可以......我把A.EXE程序的全路径以字符串形式保存为c那shell"cmd/cc"为什么运行不了呢?该怎么写呢?...
我本想用 shell /c 来实现可是不可以......
我把A.EXE程序的全路径 以字符串形式保存为c
那 shell "cmd /c c" 为什么运行不了呢?该怎么写呢? 展开
我把A.EXE程序的全路径 以字符串形式保存为c
那 shell "cmd /c c" 为什么运行不了呢?该怎么写呢? 展开
4个回答
展开全部
Dim file1, file2 As String
Private Sub Command1_Click()
If Val(Text1.Text) > Val(Text2.Text) Then Shell (file1)
'text2.text为大于这个值时 执行
If Val(Text1.Text) < Val(Text3.Text) Then Shell (file2)
'text3.text为小于这个值时 执行
End Sub
Private Sub Command2_Click()
WebBrowser1.Navigate "" & Text4.Text
End Sub
Private Sub Command3_Click()
CommonDialog1.DialogTitle = "选择路径"
CommonDialog1.ShowOpen
file1 = CommonDialog1.FileName
End Sub
Private Sub Command4_Click()
CommonDialog1.DialogTitle = "选择路径"
CommonDialog1.ShowOpen
file2 = CommonDialog1.FileName
End Sub
Private Sub Form_Load()
Timer1.Interval = 6000
End Sub
Private Sub Timer1_Timer()
WebBrowser1.Refresh
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If Not (pDisp Is WebBrowser1.object) Then Exit Sub
Dim wenben As String
Dim a() As String
wenben = Me.WebBrowser1.Document.Body.innerText
a = Split(wenben, vbCrLf)
Text1.Text = wenben
For i = 0 To UBound(a)
If InStr(a(i), "代码:") > 0 And InStr(a(i), ".s") > 0 Then
Text1.Text = Right(a(i), (Len(a(i)) - InStr(a(i), ".s")) - 2)
Text5.Text = Mid(a(i), InStr(a(i), ".s") + 1, 2)
Exit For
End If
Next i
End Sub
Private Sub Command1_Click()
If Val(Text1.Text) > Val(Text2.Text) Then Shell (file1)
'text2.text为大于这个值时 执行
If Val(Text1.Text) < Val(Text3.Text) Then Shell (file2)
'text3.text为小于这个值时 执行
End Sub
Private Sub Command2_Click()
WebBrowser1.Navigate "" & Text4.Text
End Sub
Private Sub Command3_Click()
CommonDialog1.DialogTitle = "选择路径"
CommonDialog1.ShowOpen
file1 = CommonDialog1.FileName
End Sub
Private Sub Command4_Click()
CommonDialog1.DialogTitle = "选择路径"
CommonDialog1.ShowOpen
file2 = CommonDialog1.FileName
End Sub
Private Sub Form_Load()
Timer1.Interval = 6000
End Sub
Private Sub Timer1_Timer()
WebBrowser1.Refresh
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If Not (pDisp Is WebBrowser1.object) Then Exit Sub
Dim wenben As String
Dim a() As String
wenben = Me.WebBrowser1.Document.Body.innerText
a = Split(wenben, vbCrLf)
Text1.Text = wenben
For i = 0 To UBound(a)
If InStr(a(i), "代码:") > 0 And InStr(a(i), ".s") > 0 Then
Text1.Text = Right(a(i), (Len(a(i)) - InStr(a(i), ".s")) - 2)
Text5.Text = Mid(a(i), InStr(a(i), ".s") + 1, 2)
Exit For
End If
Next i
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
可以直接用Shell "文件路径"
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
要写具体的路径
如
Private Sub Command1_Click()
Shell "C:\Documents and Settings\new\桌面\AWP辅助准星2.exe /play g:\01.rmvb", 1
End Sub
如
Private Sub Command1_Click()
Shell "C:\Documents and Settings\new\桌面\AWP辅助准星2.exe /play g:\01.rmvb", 1
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
shell 加路径就可以
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询