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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript to mask password in a batch file

Status
Not open for further replies.

JROY2011

IS-IT--Management
Aug 24, 2011
12
0
0
US
I currently have a batch file (below) that runs fine, but when it prompts for the password it displays the text on the screen. Is there a script I can run that will hide/mask the password as its being typed? I am running this batch file in WinPE if that matters.

@ECHO OFF

::VARIABLES
SET title=IMAGEX IMAGE MENU
SET script_dir=%0\..

cls

diskpart.exe /s f:\diskpart.txt
set /P user=Enter your username:
set /P pass=Enter your password:
net use o: \\network_path /USER:domain\%user% %pass%
pause
e:\imagex.exe /apply o:\Windows7.wim 1 C:
C:\windows\system32\bcdboot C:\windows
pause
exit
 
This link has a sample script to do what you ask.



I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
So I would need a script with that first set of code, then in my batch I would call it by inserting:

strPw = GetPassword( "Enter your password:" )

?
 
Why use a batch at all?

I hope that helps.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top