Home / Microsoft / Microsoft DOS / Password
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Password  (Read 3804 times)
.bat_man
Topic Starter
Beginner



Posts: 86

Will Smith

« on: March 26, 2008, 06:53:46 AM »

i want to right a bat file that reads user name and password
and i want  password not to be displayed or to be replaced by **** when i type it in the prompt
any one can help
thanks for ur Interests    :)
IP logged
Carbon Dudeoxide
Global Moderator
Mastermind


Thanked: 145
Posts: 16,077

Certifications: List
Computer: Specs
Experience: Expert
OS: Mac OS


Carbon - The building block of life on Earth.

My Youtube Profile 1 1
« Reply #1 on: March 26, 2008, 07:06:11 AM »

You can display your username by typing echo %username% in command prompt.

There is no way to display the user password.
IP logged

.bat_man
Topic Starter
Beginner



Posts: 86

Will Smith

« Reply #2 on: March 26, 2008, 07:25:22 AM »

sorry
i didnt make my question clear
i am using apat file to access a database throw  sqlplus prompt and of corse the sqlplus requers an user name and password
and as u know it's not applicable to make the password to be seen by othe peuple for that i request if there is any way to type the password without seeing it in the prmpt like this

please enter user names: dddd
please enter Password: PPPP

so i dont want the password to be displayed in the promp wihle i am writing it
thanks for ur considration
IP logged
devcom
Apprentice



Thanked: 37
Posts: 521


« Reply #3 on: March 26, 2008, 10:01:47 AM »

here is my "code"
Code: [Select]
@echo off
set rightpass=dunno
set pass=Password:
:A
cls
echo %pass%
choice /c abcdefghijklmnopqrstuvwxyz09 >nul
if %errorlevel% equ 1 set letter=a& set pass=%pass%*& goto NEXT
if %errorlevel% equ 2 set letter=b& set pass=%pass%*& goto NEXT
if %errorlevel% equ 3 set letter=c& set pass=%pass%*& goto NEXT
if %errorlevel% equ 4 set letter=d& set pass=%pass%*& goto NEXT
if %errorlevel% equ 5 set letter=e& set pass=%pass%*& goto NEXT
if %errorlevel% equ 6 set letter=f& set pass=%pass%*& goto NEXT
if %errorlevel% equ 7 set letter=g& set pass=%pass%*& goto NEXT
if %errorlevel% equ 8 set letter=h& set pass=%pass%*& goto NEXT
if %errorlevel% equ 9 set letter=i& set pass=%pass%*& goto NEXT
if %errorlevel% equ 10 set letter=j& set pass=%pass%*& goto NEXT
if %errorlevel% equ 11 set letter=k& set pass=%pass%*& goto NEXT
if %errorlevel% equ 12 set letter=l& set pass=%pass%*& goto NEXT
if %errorlevel% equ 13 set letter=m& set pass=%pass%*& goto NEXT
if %errorlevel% equ 14 set letter=n& set pass=%pass%*& goto NEXT
if %errorlevel% equ 15 set letter=o& set pass=%pass%*& goto NEXT
if %errorlevel% equ 16 set letter=p& set pass=%pass%*& goto NEXT
if %errorlevel% equ 17 set letter=q& set pass=%pass%*& goto NEXT
if %errorlevel% equ 18 set letter=r& set pass=%pass%*& goto NEXT
if %errorlevel% equ 19 set letter=s& set pass=%pass%*& goto NEXT
if %errorlevel% equ 20 set letter=t& set pass=%pass%*& goto NEXT
if %errorlevel% equ 21 set letter=u& set pass=%pass%*& goto NEXT
if %errorlevel% equ 22 set letter=v& set pass=%pass%*& goto NEXT
if %errorlevel% equ 23 set letter=w& set pass=%pass%*& goto NEXT
if %errorlevel% equ 24 set letter=x& set pass=%pass%*& goto NEXT
if %errorlevel% equ 25 set letter=y& set pass=%pass%*& goto NEXT
if %errorlevel% equ 26 set letter=z& set pass=%pass%*& goto NEXT
if %errorlevel% equ 27 goto CHECK
if %errorlevel% equ 28 set pass=Password:& set yourpass=& goto A
:NEXT
set yourpass=%yourpass%%letter%
goto A
:CHECK
if %yourpass% equ %rightpass% (goto GOOD) else (echo.Wrong Pass! & pause >nul & set yourpass=&set pass=Password:)
goto A
:GOOD
echo.Accepted!
pause >nul
hope it help
use 0 to chcek if password is good and 9 to clear password and yes i know then in password cant be numbers
IP logged

Download: Choice.exe
.bat_man
Topic Starter
Beginner



Posts: 86

Will Smith

« Reply #4 on: March 27, 2008, 03:35:22 AM »

thanks a lot
IP logged
.bat_man
Topic Starter
Beginner



Posts: 86

Will Smith

« Reply #5 on: March 27, 2008, 10:07:58 AM »

 i up graded the code because i don't have the choice command on my prompt so i wrote it this
:)

@echo off
cls
set u=
set /p u=please enter user names:
set tx=please enter Password end it with !:
cls
:A
echo please enter user names: %u%
set /p p2=%tx%
set tx=%tx%^*
if %p2:~-1%==! goto B
set p=%p%%p2%
cls
goto A
:B
REM then the rest of the code

:)
IP logged
devcom
Apprentice



Thanked: 37
Posts: 521


« Reply #6 on: March 27, 2008, 11:51:20 AM »

This is quted message that WillyW sended to me
Quote from: WillyW
Anyway,   you can add    choice    to your XP system.
All you need is the right file, and then put a copy of it in a directory that is in your path.

In that thread there is a post by me that includes this link:
http://hp.vector.co.jp/authors/VA007219/dkclonesup/choice.html
Lots to read there.    Take your time.   You can download     
  choice    there.

I hope this helps.

and your code is good to but you need always press enter in my you dont have
IP logged

Download: Choice.exe
Tan_Za
Intermediate



Posts: 131

Experience: Experienced
OS: Windows 7


Starcraft and Pascal programming YAY

« Reply #7 on: March 28, 2008, 05:24:48 AM »

You could look at other options and by just gettin an windows 2000 emulated then use devcom's code. Make the batch file and .exe and copy it to your normal computer. It should run independently. I think so anyway. It works for me.   ♦

Tan_Za
IP logged
.bat_man
Topic Starter
Beginner



Posts: 86

Will Smith

« Reply #8 on: April 04, 2008, 06:21:46 AM »

i think that this is the best code inter ur user name and password without being afraid that some on see ur password

@echo off
cls
set u=
set /p u=please enter user names:
set tx=please enter Password end it with !:
cls
:A
echo please enter user names: %u%
echo %tx%
choice /n /c:abcdefghijklmnopqrstuvwxyz1234567890#! > ta
for /f %%i in (ta) do set p2=%%i
del ta
set tx=%tx%^*
set p=%p%%p2%
if %p:~-1%==! goto B
cls
goto A
:B
set p=%p:~0,-1%
ur code

i think this will make it easier for all people how will face the same problem as i faced

thanks for all who helped
IP logged
devcom
Apprentice



Thanked: 37
Posts: 521


« Reply #9 on: April 04, 2008, 07:01:48 AM »

you can just open ta file with notepad and you have password
IP logged

Download: Choice.exe
.bat_man
Topic Starter
Beginner



Posts: 86

Will Smith

« Reply #10 on: April 04, 2008, 07:17:25 AM »

no man
it will be impossible because as u see the code when i insert the choice result into the file it will be only one char and next that immediatly i delete the file and recreate it again when the next choice statment comes and even if i can take tha password from the file that is not important pecause my target is to hide it from my nabers how work around me thats all
 :)
IP logged
Pages: [1] - (Top) Print 
Home / Microsoft / Microsoft DOS / Password « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.109 seconds with 20 queries.