Do you have a scripting-related question or problem? You can send your question or problem to winscriptsol@win2000mag.com.
I need to create a script that prompts the operator for a password. I know that I can use VBScript's InputBox function or the WScript object's StdIn property in Windows Script Host (WSH) to prompt the user. However, both InputBox and StdIn display the password as the user types it. I prefer to mask the password. Does VBScript or WSH provide a way to mask passwords?
Neither VBScript nor WSH can mask passwords. However, Windows .NET Server (formerly code-named Whistler) and Windows XP include a new password component, scriptpw.dll, that provides this functionality. Script-pw.dll is a standard system component that resides in the \%system root%\ system 32 directory.
Listing 1 illustrates how you can use scriptpw.dll to retrieve a user's password without displaying the password as the user types it. The script begins by creating an instance of the Password object using VBScript's Create-Object function with the password component's programmatic identifier (ProgID), ScriptPW.Password. . . .
Andrew Good September 01, 2003