Contact Info

Crumbtrail » Administration » VBScript Collection » Scripting Techniques » Masking Passwords

Masking Passwords Techniques

Mask Command Line Passwords
Mask Passwords Using Internet Explorer

You can use any of the VBScript programs below in ActiveXperts Network Monitor. Click here for an explanation about how to include scripts in ActiveXperts Network Monitor.

Mask Command Line Passwords

Demonstration script that uses ScriptPW.dll to mask passwords entered at the command line.
Set objPassword = CreateObject("ScriptPW.Password") 
WScript.StdOut.Write "Please enter your password:" 

strPassword = objPassword.GetPassword() 
Wscript.Echo "Your password is: " & strPassword

Mask Passwords Using Internet Explorer

Demonstration script that creates an instance of Internet Explorer, and retrieves a password typed into a password-style text box. Requires a Web page named password.htm with the appropriate text box.
Set objExplorer = WScript.CreateObject _
    ("InternetExplorer.Application", "IE_")

objExplorer.Navigate "file:///c:\scripts\password.htm"   
objExplorer.Visible = 1             
objExplorer.ToolBar = 0
objExplorer.StatusBar = 0
objExplorer.Height = 250 
objExplorer.Left = 0
objExplorer.Top = 0

Do While (objExplorer.Document.Body.All.OKClicked.Value = "")
    Wscript.Sleep 250                 

strPassword = objExplorer.Document.Body.All.PasswordBox.Value

Wscript.Sleep 250
Wscript.Echo strPassword