Board logo

标题: 请教个VBS提示框的问题~ [打印本页]

作者: 77720666     时间: 2007-4-21 15:59    标题: 请教个VBS提示框的问题~

if msgbox ("提示内容",vbRetryCancel,"标题") = vbRetry then
dim bag,pipe
set bag=getobject("winmgmts:\\.\root\cimv2")
set pipe=bag.execquery("select * from win32_process where name='QQ.exe'")
for each i in pipe
i.terminate()
next
Set Ws=WScript.CreateObject("WScript.Shell")
Ws.run "QQ.exe"
else
end if

请问改成按"重试"执行我的代码后返回对话框~按"取消"就退出!

那位大大帮忙改改~找了百度想了很久也搞不定~
作者: lxmxn     时间: 2007-4-21 16:43
试试这个,没有测试。
if msgbox ("提示内容",vbRetryCancel,"标题") = vbRetry then
dim bag,pipe
set bag=getobject("winmgmts:\\.\root\cimv2")
set pipe=bag.execquery("select * from win32_process where name='QQ.exe'")
for each i in pipe
i.terminate()
next
Set Ws=WScript.CreateObject("WScript.Shell")
Ws.run "QQ.exe"
else wscript.quit(0)
end if

作者: slore     时间: 2007-4-21 21:59
Dim Go2End
Do
    If Msgbox ("提示内容",vbRetryCancel,"标题") = vbRetry Then
        Dim bag,pipe
        Set bag=Getobject("winmgmts:\\.\root\cimv2")
        Set pipe=bag.execquery("Select * from win32_process where name='QQ.exe'")
        For Each i In pipe
            i.terminate()
        Next
        Set Ws=WScript.Createobject("WScript.Shell")
        Ws.run "QQ.exe"
        Go2End=False
    Else
        Go2End=True
    End If
Loop Until Go2End=True
作者: 77720666     时间: 2007-4-22 15:21
二楼的试过了~不行~谢了~
三楼的可以了~非常感谢~

PS请问哪里有VBS的基础教程?