d

WSH to Create a Popup Dialog Box

Show a popup message with Title, Buttons, Read Results of user click


/**
 *    Name:           wshpopup.js
 *    Description:    Simple script to show a WSH Popup Message Box.
 *    Author:         Daren Thiel
 *    Date:           31 Oct 1998
 *    Web:            http://www.winscripter.com
 **/
/* Function to encapsulate a Popup */
function showit()
{
  var Message = "This is my first popup";
  var timeout = 0;
  var title   = "This is the title";
  var buttons = 65;
  var rslt;
  var WS = WScript.CreateObject("WScript.Shell");
  rslt = WS.Popup(Message, timeout, title, buttons);
  if ( rslt == 2 ) {
    WScript.Quit();
  } 
}

/* Call the function */
showit();