vendredi 23 janvier 2015

Test to see if message box was closed with "X" Button VBS

Hello (Two questions in one night may be overkill but I'm down to the last minute!) I am trying to launch files based off of a user choice from a message dialog with vbs. This works however I want to test to see if the user clicks the "X" button in the top right corner instead of clicking "OK" Here is the code I have.



set shell=createobject("wscript.shell")
x=msgbox("Message...." ,0+16, "Error:")
If x=1 Then
shell.run "P:\Test.bat"
End If


However I want to use an if statement to test if the user clicked "X".


Aucun commentaire:

Enregistrer un commentaire