Vbs script opening a program on a message box
I need a vbs script with a message box that opens iexplorer when I click yes, and close the msg box when I click no. Thanks, I am new to programming, and need help. Thank you.
2 answers
-
answered 2018-03-13 21:22
bfl
You can use this:
response = MsgBox("Would you like to open Internet Explorer?", vbYesNo) If response = vbYes Then WScript.CreateObject("WScript.Shell").Run("iexplore") End If
-
answered 2018-03-13 21:22
Hackoo
Give a shoot for this code :
Option Explicit Dim Title,Answer,ws,Site Site = "https://stackoverflow.com/" Title = "Open iexplore.exe" Answer = MsgBox("Did you want to open iexplore.exe ?",VbQuestion+VbYesNo,Title) If Answer = vbYes Then set ws = CreateObject("wscript.shell") ws.run("iexplore.exe" &" "& Site) End If Wscript.Quit()