@echo off
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>in.com
set /p password=Enter password:
for /f "tokens=*" %%i in ('in.com') do set "password=%%i"
del in.com
echo.
echo The Password is:"%password%"
You can easily change this batch file with help of our award-winning tool Dr.Batcher. Hope you'll find both of them (script and tool) useful.
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>in.com
set /p password=Enter password:
for /f "tokens=*" %%i in ('in.com') do set "password=%%i"
del in.com
echo.
echo The Password is:"%password%"
You can easily change this batch file with help of our award-winning tool Dr.Batcher. Hope you'll find both of them (script and tool) useful.
this doesn't work..
ReplyDelete@echo off
Deleteecho hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>in.com
<nul: set /p password=Enter password:
for /f "tokens=*" %%i in ('in.com') do set "password=%%i"
del in.com
echo.
echo The Password is:"%password%"
pause
What operating system do you use? In my case everything works fine!
ReplyDeleteI cant get it to work either,, i just echos back the same password? it also creates and "in" named bat file side process... Anything you see wrong?
ReplyDelete'in.com' is used to hide your password from publishing it on the screen. when you type something, it shows nothing, but when you press return key, it shows the string you have entered.
ReplyDeletethe problem is with 'set /p password=Enter Password:'
ReplyDeleteInstead just use 'echo Enter Password:'
I have no idea how the strange characters echoed to in.com work with 'for /f "tokens=*"' statement.
but I can now hide a password request and ftp a file from my pc to a mainframe via a bat file
Hi
ReplyDeleteI was trying to run the following from a 64 bit Windows machine .
@echo off
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>in.com
echo Enter password:
for /f "tokens=*" %%i in ('in.com') do set "password=%%i"
del in.com
echo.
echo The Password is:"%password%"
But the password is shown as space in the last line.
Here, you echoed the statement "Enter password:" but you never prompted for an input with /p not set the password to anything.
Deleteset /p password="Enter Password:"
The trick is to make sure no white space is exist, otherwise dos treats it differently.
in.com will be a 16-bit executable, which will not run on any 64-bit version of Windows.
ReplyDeleteWhat is the solution for Windows 7 ?
Deletethis worked fine to me in windows 7
ReplyDelete:PASSWORD
cls
echo.
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>in.com
echo Enter your password:
for /f "tokens=*" %%i in ('in.com') do set "password=%%i"
del in.com
echo.
if %password%==P@ssword2012 goto ok
goto ERROR2
:ok
bla bla bla....
:ERROR2
bla bla bla
pause
It may work on Win 7, but not on 64 bit version - this is my problem, anyone have a solution for 64 bit?
ReplyDeleteI had to do the "echo enter password" command instead of using set /p but it works!
ReplyDeleteNow ... what is this? Why does this work? Really weird. What is the string if gibberish all about?
hola, estoy tratando de usar este comando pero cuando ejecuto el bat se cierra el cmd. tengo windows 7.
ReplyDeleteany tips for making a predefined password in a batch file?
ReplyDeleteCode is working perfectly ok. Thanks
ReplyDeleteThis is unfortunately not working for 64 bit Windows. is there a version for 64 bit windows?
ReplyDeleteit does not work in windows xp?
DeleteUniversal code for 32 and 64 bit Windows systems:
Deletefor /f "tokens=*" %%i in ('cmd /q /v:on /c "set /p p=&if defined p echo !p!"') do echo "%%i"
Universal Windows code:
ReplyDelete@echo off
<nul set /p password=EnterPassword:
for /f "tokens=* delims=" %%i in ('cmd /q /v:on /c "set /p p=&if defined p <nul set /p =!p!"') do set "password=%%i"
echo.
echo The Password is: "%password%"
pause