You
can obtain this example on the Sybex Web site at http://www.sybex.com/WileyCDA/.
Listing 6.1: Working with the Command Line and System Environment
// ProgInfo.JS determines the specifics about your program and then
// displays this information on screen.
// Create some constants for display purposes (buttons and icons).
var intOK = 0;
var intOKCancel = 1;
var intAbortRetryIgnore = 2;
var intYesNoCancel = 3;
var intYesNo = 4;
var intRetryCancel = 5;
var intStop = 16;
var intQuestion = 32;
var intExclamation = 48;
var intInformation = 64;
// Create some popup return values.
var intOK = 1;
CREATING A BASIC SCRIPT 173
var intCancel = 2;
var intAbort = 3;
var intRetry = 4;
var intIgnore = 5;
var intYes = 6;
var intNo = 7;
var intClose = 8;
var intHelp = 9;
// Create a popup display object.
var WshShell = WScript.CreateObject(???WScript.Shell???);
// Create a variable for holding a popup return value.
var intReturn;
// Get the program information and display it.
WshShell.Popup(???Full Name:\t??? + WScript.Fullname +
???\r\nInteractive:\t??? + WScript.Interactive +
???\r\nName:\t\t??? + WScript.Name +
???\r\nPath:\t\t??? + WScript.
Pages:
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449