TIPs of VB Scripts
- Run Exe
Intro = msgbox("Auto Patch Update", vbyesno+vbquestion ,"Auto Patch Update")
if Intro = VByes then
set shell=createobject("wscript.shell")
shell.run "C:\WINDOWS\system32\calc.exe"
set shell=nothing
else
msgbox "No Open Calc"
end if
- Hide Batch Windows
shell.run "t.bat",[intWindowStyle], [bWaitOnReturn]
intWindowStyle = 0 is hide windows command, 1 is show windows command
bWaitOnReturn = true is wait command finished and run next statement, false is run no waiting (default)
- AutoClose Popup
Dim ShellObj, BtnCode
Set ShellObj=CreateObject("WScript.Shell")
BtnCode=ShellObj.Popup("Patch Auto Update?", 10, "Server Message", 36)
Select Case BtnCode
Intro = msgbox("Auto Patch Update", vbyesno+vbquestion ,"Auto Patch Update")
if Intro = VByes then
set shell=createobject("wscript.shell")
shell.run "C:\WINDOWS\system32\calc.exe"
set shell=nothing
else
msgbox "No Open Calc"
end if
- Hide Batch Windows
shell.run "t.bat",[intWindowStyle], [bWaitOnReturn]
intWindowStyle = 0 is hide windows command, 1 is show windows command
bWaitOnReturn = true is wait command finished and run next statement, false is run no waiting (default)
- AutoClose Popup
Dim ShellObj, BtnCode
Set ShellObj=CreateObject("WScript.Shell")
BtnCode=ShellObj.Popup("Patch Auto Update?", 10, "Server Message", 36)
Select Case BtnCode
Case -1 rem -1 = timeout
MsgBox "Timeout"
Case 6 rem 6 = Yes
MsgBox " Yes "
Case 7 rem 7 = No
MsgBox " NO "
End Select
MsgBox "Timeout"
Case 6 rem 6 = Yes
MsgBox " Yes "
Case 7 rem 7 = No
MsgBox " NO "
End Select
Comments
Post a Comment