batch file - Make cmd window on top of others -


I am working on simple batch scripts so that the user can hide the password. Its solution is to create a popup and change the text-color for that popup. The following is the code and it works properly

  @echo off Echo Please enter your password in the popup window and then set Tempbat = "% temp% \ p.cmd" to REM Temporarily Create batch password 'masked' echo mode 20.1 & gt;% tempbat% echo color 01 & gt; File & gt;% tempbat% echo setlocal enabled xpation & gt; to create a popup window for entering enter password enter the% tempbat% echo. & Gt;%% Tempbat% echo set / p pass = & gt; & Gt;% tempbat% echo echo! Pass ^ ^ "% temp% \ pass.txt" gt; & Gt;% tempbat% Exit Acquire & gt; & Gt;% tempbat% start / wait ""% tempbat% del% tempbat% 2 & gt; NUL Set / P PWD = & lt; "% Temp% \ pass.txt" del "% temp% \ pass.txt" 2> My only concern is when a popup occurs, I can always set it at the top of the main CMD window, and disable access to the main CMD window. Can also do (I hope to behave like bootstrap model)?   

Instead of trying to cover the password with something, the user in the batch It is possible to obscure the input. See Code of MC ND:

  @echo off setlocal enableextensions Disabled Expansion Call for sub-routine to get the RIM password: GetPassword password rem echo What is the password defined if you type password Are]%]) and (echo you have not typed anything) rm process to get the password to endlocal exit / b rem sub to get the password: getPassword returnVar setlocal enabled extension disabledelayedexpansion set "_password =" rem We are character Set to / f%% A in ("Prompt; $ H & amp; %% b in (0) Reem") "BS = %% A" Rim Prompt User Set / P "= Password? "& Lt; Nul: KeyLoop rem for a keypress set "key =" / f "delims =" %% a ('xcopy / l / w'% ~ f0 ""% ~ f0 "2 ^> nul ') Set key "key = %% a" set "key =% key: ~ -1%" Control the RIM Compass rim If there is no keypress, then rifle with backspace, remove the console from the password and Remove the console and add the password to the character and define the key (if "% key%" == "% BS%" (if defined _password (set "_password =% _ password: ~ 0, -1%" setlocal enabledelayedexpansion & Amp; Set / W "=! B !!! BS!" & Nt; Null & amp; Endolocal) Other (Set "_password =% _ password %% key%" set / p "= *" and lieutenant; neule) Goto: Chabiloop ) Echo (set the "exitcode = 1" set) if the reef returns the password to the collar if the defined _password is set ("exitcode = 0") and the other "set% ="% = 1% _ password% "and exit / B% exitCode%  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -