Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Entry displayed as "******"

Status
Not open for further replies.

roles40

MIS
Aug 20, 2003
21
US
Is there any way to mask a msgbox entry as *****'s to hide a password?
 
If you mean InputBox, then no. If you need to get user password input, the best bet is to create an HTA then you can create a password input field.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
roles40,

Another way is to use Bill Stewart's excellent freeware third-party dll. 'PassDlg.dll' can be obtained from Add it to the system folder then register it to use.

Below is an example to popup a dialog asking for the Administrator password before running 'Add/Remove Programs' as Administrator.

Code:
Dim WSH, AdminPassWrd, PassDlg, prog
Set WSH = WScript.CreateObject("WScript.Shell")
Set PassDlg = CreateObject("PassDlg.PasswordDialog")
PassDlg.ShowDialog "Administrator password required"
AdminPassWrd = PassDlg.Password
prog = "runas.exe /env /user:Administrator "
prog = prog & """Control %systemRoot%\system32\appwiz.cpl,System"""
WSH.Run prog,2,false
WScript.Sleep 500
WSH.Sendkeys AdminPassWrd
WSH.Sendkeys "~"

'Finish up
Set WSH = Nothing
Set PassDlg = Nothing

Hope this helps...

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top