PassDlg.dll 2.3

PassDlg.dll is copyright © 2002-2009 by Bill Stewart (bstewart@idoname.com). (Remove do when mailing.)

Home page: http://www.westmesatech.com/

Download: http://www.westmesatech.com/files/PassDlg23.msi (1,385,472 bytes; 4 Jun 2009)

Table of Contents

Introduction

License

Using The Component

Examples

Version History

Introduction

Windows Scripting Host (WSH) is a technology installed with Internet Explorer and newer versions of Windows that provides a robust scripting interface. It is an excellent choice for automating routine tasks. However, it lacks a method to prompt for password input. You could use the VBScript InputBox() function, but it doesn't hide the typed text, as is preferred for passwords. That's why I wrote PassDlg.dll. PassDlg's objects can display the following types of dialog boxes:

A password dialog box that displays a single password.

A password dialog box that displays two password fields for confirmation purposes.

A logon dialog box that displays a user name and password. You may specify an initial username.

A logon dialog box that displays a user name and two password fields (for confirmation).

You may customize the title of these dialog boxes, enforce whether a blank user name and/or password are allowed, and set a maximum password length. Your code can also detect if the dialog box was canceled.

License

This component may be used freely in any environment without payment to the author, provided you abide by the following:

This component is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using the Component

After the PassDlg.dll component is installed, you can use a program or script to create the following objects:

PassDlg.LogonDialog
PassDlg.PasswordDialog

The LogonDialog object contains the user name field; the PasswordDialog object does not.

The PasswordDialog object has the following properties:

Property Put/Get Description Default
AllowBlankPassword Put Allow a blank password? True
Confirm Put Show two password input lines? False
Canceled Get Was the dialog canceled? N/A
Password Get Password N/A

The LogonDialog object has the following properties:

Property Put/Get Description Default
AllowBlankUserName Put Allow a blank user name? True
AllowBlankPassword Put Allow a blank password? True
Confirm Put Show two password input lines? False
Canceled Get Was the dialog canceled? N/A
UserName Both User name (blank)
Password Get Password N/A

Both objects support the following method:

ShowDialog([dialogtitle[, maximumpasswordlength]])

Examples

Please see the PassDlgTest.vbs and PassDlgTest.js scripts for examples.

Version History

Version 2.3 (2009 June 3):

Version 2.2 (2004 October 27):

Version 2.1 (2004 June 30):

Version 2.0 (2003 July 28):

Version 1.0 (2002 March 11):