윈 도 우 set /p PW= 질문입니다
2019.07.16 02:38
이러면 패스워드 입력부분이 모두 노출됩니다. ***** 나오도록 하는 방법 있을까요?
댓글 [4]
-
comadot 2019.07.16 20:43
-
지룡자 2019.07.20 14:23
허걱 감사합니다.
-
comadot 2019.07.16 20:56
@echo off & setlocal
Title %~n0
Mode 50,5 & Color 9E
Set /P "Pass1=Please choose your Password:" < Nul
call :HInput Pass1
echo Input length is %errorlevel%
setlocal EnableDelayedExpansion
echo Your password is !Pass1!
pause
cls
Set /P "Pass2=Please confirm your Password:" < Nul
call :HInput Pass2
echo Input length is %errorlevel%
echo Your password is !Pass2!
pause
cls
If !Pass1!==!Pass2! (echo the two passwords are the same
) else (echo the two passwords does not match)
pause
goto :eof
:HInput [ByRef_VarName]
:: inspired by Carlos
if "%__HI__%" neq "__HI__" (
setlocal DisableDelayedExpansion EnableExtensions
set "CR=" &set "S=" &set "N=0" &set "__HI__=__HI__"
for /f "skip=1" %%i in ('echo(^|replace ? . /u /w') do if not defined CR set "CR=%%i"
for /f %%i in ('"prompt $H &for %%b in (1) do rem"') do set "BS=%%i"
)
set "C="
for /f skip^=1^ delims^=^ eol^= %%i in ('replace ? . /u /w') do if not defined C set "C=%%i"
setlocal EnableDelayedExpansion EnableExtensions
if "!CR!"=="!C!" (
echo(
if "%~1"=="" (
echo(!S!
endlocal &endlocal &exit /b %N%
) else (
if defined S (
for /f delims^=^ eol^= %%i in ("!S!") do endlocal &endlocal &set "%~1=%%i" &exit /b %N%
) else endlocal &endlocal &set "%~1=" &exit /b 0
)
)
if "!BS!"=="!C!" (
set "C="
if defined S set /a "N -= 1" &set "S=!S:~,-1!" &<nul set /p "=%BS% %BS%"
) else set /a "N += 1" &<nul set /p "=*"
if not defined S (
endlocal &set "N=%N%" &set "S=%C%"
) else for /f delims^=^ eol^= %%i in ("!S!") do endlocal &set "N=%N%" &set "S=%%i%C%"
goto HInput역시 구글에서 찾았습니다.
이건 **로 표시되네요~
-
지룡자 2019.07.20 14:23
좀 길지만 대단히 감사합니다.
번호 | 제목 | 글쓴이 | 조회 | 등록일 |
---|---|---|---|---|
[공지] | 질문과 답변 게시판 이용간 유의사항 | gooddew | - | - |
94308 | 7600 인증 질문 ㅠㅠ [2] | seven | 2330 | 08-15 |
94307 | 게임 해상도 지원 질문좀 ㅜㅜ [1] | 고우성 | 2230 | 08-15 |
94306 | 익스플로러 8 한글이 깨지는 현상 수정방법 질문 | KaRaS | 2952 | 08-15 |
94305 | 아죽긋습니다 제발 도와주세요 ㅠㅠ [13] | 스톤콜드 | 2641 | 08-15 |
94304 | SIGMA Penta HDTV5 사용자 계신가요? [2] | 이기한 | 4522 | 08-15 |
94303 | windows virtual pc 다른분은 작동이 잘 되나요? [4] | lovely0401 | 2667 | 08-16 |
94302 | XP 64bit에서 Win7으로 업그레이드~??? [4] | 홍영훈 | 2848 | 08-16 |
94301 | 아직도 5.1채널때문에 씨름중입니다.ㅠ [3] | 형법 | 2731 | 08-16 |
94300 | 엠넷m플레이어설치하니까요 | 따라뚜룹 | 3188 | 08-16 |
94299 | MSDN XP HOME KN SP3 시디키 구하기 힘드네요ㅠㅠ [1] | 영웅문1 | 19210 | 08-16 |
94298 | 사이드바 가젯과 사이드쇼 가젯의 차이점이 뭔가요? [3] | 400번 | 3583 | 08-16 |
94297 | 파티션 나눈 후 부팅 [4] | 조민기 | 2454 | 08-16 |
94296 | 노트북컴맹이 노트북을삿습니다. [4] | 유일 | 2339 | 08-16 |
94295 | outlook express (아웃룩)은 어디에? [3] | 햏자요 | 3693 | 08-16 |
94294 | kms 가 머죠?? [2] | lovely0401 | 4635 | 08-16 |
94293 | Windows 2008 Server 를 메인으로 사용하기에 불편한가요?? [3] | ddya | 2345 | 08-16 |
94292 | USB 레디부스터 기능에대하여 질문드립니다.~^^~ [2] | 증발 | 2341 | 08-16 |
94291 | 탐색기 에러.. [3] | 사나이 | 2459 | 08-16 |
94290 | RAM점유율 신기하네요~[윈도우세븐 32bit] [1] | 증발 | 2905 | 08-16 |
94289 | 또질문하게되네요 ㅠㅠ 이번엔 인증질문입니다 [4] | smr0131 | 1996 | 08-16 |
@echo off
setlocal
set /P "=_" < NUL > "Enter password"
findstr /A:1E /V "^$" "Enter password" NUL > CON
del "Enter password"
set /P "password="
cls
color 07
echo The password read is: "%password%"
구글에서 찾았습니다.
* 표시가 아니고 입력하는게 안보이네요~