hide user input.
Posted: 30 Jun 2011 01:49
How do i hide user input. This is for password field. I don want the password to be visible. I tried searchin in google. Couldn find any
Code: Select all
>nul set /p myvar=[promptString]
Code: Select all
set input=
:loop
>nul CHOICE /c:abcdefghi.........
set input=%input%%errorlevel%
if /i ["input"] neq ["659872"] goto :loop
Ed Dyreen wrote:this is what cleo means:
Ed Dyreen wrote:☺
Euh cleo, best not advertise beta products to our friends...
An alpha is on the way
Code: Select all
3E73E01A529AF309F5015A50967158C4A3151CC19F6F6A078E47147455688AD99EE9B2F3675306D3535345A64058E52FC67FAD7F75E2B155CEFA0
C187CFB1F05EB2A09C614DEE4D687E65F9B2766EA9504C49FAC81CC434EF1622EE43F3C3C3AD625D9CECA11FAEDB372BBA0FE651F1891492743108855A39A4651769F06DA39019310
4FD86506F1D44386C59F16EE75E27FBBB1A3F0E326AF87242E581A
Code: Select all
@echo off
:: GetPwd.cmd - Get password with no echo.
<nul: set /p passwd=Password:
for /f "delims=" %%i in ('cscript /nologo GetPwd.vbs') do set passwd=%%i
echo.
:: This bit's just to prove we have the password.
echo %passwd%
Code: Select all
Set oScriptPW = CreateObject("ScriptPW.Password")
strPassword = oScriptPW.GetPassword()
Wscript.StdOut.WriteLine strPassword
Cleptography wrote:Ed Dyreen wrote:☺
Euh cleo, best not advertise beta products to our friends...
An alpha is on the way
You are absolutely correct I just checked v1 and realized inputbox had not been built yet.
@arjun2988
I put this together real quick for you as an example. This will show you masked input boxes, and an example of RC4 encryption.
http://www.scriptingpros.com/scripts/cleptography/PasswordExample.zip
I use this same method if I want to encrypt my batch files instead of compiling them into useless exe's that dump the source into the temp directory. I just include the encryption tool along with my script. Encrypt a password to decrypt the script, and I end up with a batch file that looks like this.Code: Select all
3E73E01A529AF309F5015A50967158C4A3151CC19F6F6A078E47147455688AD99EE9B2F3675306D3535345A64058E52FC67FAD7F75E2B155CEFA0
C187CFB1F05EB2A09C614DEE4D687E65F9B2766EA9504C49FAC81CC434EF1622EE43F3C3C3AD625D9CECA11FAEDB372BBA0FE651F1891492743108855A39A4651769F06DA39019310
4FD86506F1D44386C59F16EE75E27FBBB1A3F0E326AF87242E581A
Run it through the decrypt app and execute the batch script.
Good luck
If you are on an XP machine you can use a combo of batch / vbs. This method apparently will not work on later versions or rather you would need scriptpw.dll to run it.
GetPwd.batCode: Select all
@echo off
:: GetPwd.cmd - Get password with no echo.
<nul: set /p passwd=Password:
for /f "delims=" %%i in ('cscript /nologo GetPwd.vbs') do set passwd=%%i
echo.
:: This bit's just to prove we have the password.
echo %passwd%
GetPwd.vbsCode: Select all
Set oScriptPW = CreateObject("ScriptPW.Password")
strPassword = oScriptPW.GetPassword()
Wscript.StdOut.WriteLine strPassword
You could also check here: http://www.computerhope.com/forum/index.php?topic=69496.0
nitt wrote:Not many people have XP these days, and who would even want to use a method only compatible with a single operating system?