Solved how to creat a login with Register file save of all user

September 21, 2014 at 06:00:08
Specs: Windows 7
HI,
I'm new here and i need help for creating a login system that have a simple database or text file with all of the user that are registered.i saw on in the forums but i can't make it work to save the .txt file in the location that i want.

please help


See More: how to creat a login with Register file save of all user

Report •


✔ Best Answer
September 21, 2014 at 18:04:26
I don't see what's not working in the code you posted, except for this line:
echo %pass% >> %user%.txt
which will append a space to the password. You want either of these:
>%user%.txt echo %pass%
OR
echo %pass%>%user%.txt
(also note the >> should be >)

If it was me, I would use the password to encrypt the username into either a random file, or a file named as username. Password is then verified by de-crypting the file and comparing the decrypted content with the entered username. There are many free encryptors available - PKZIP etc,



#1
September 21, 2014 at 06:34:57
Do you mean you wish to have a simple composite record (database) containing all authorised users' individual login - "and password" details; or just a list of users and their login (only - no password information)?

Or do you wish to make or do something more?

What application are you using to make this "database"?

Where are you trying to save the file; and do you manage to create it at least in .txt format (or any other)?


Report •

#2
September 21, 2014 at 06:43:19
sorry for the confusion i need a composite record of all the user and password in short all information to them.i saw this code in the forums.but unfortunately i can't make it to save the file (login info)in the folder i want to use,if you can help me create a batch file with the same function as below.

the code below are form the post of UndeadDino and mikelinus


title login
color 0b

:menu
cls
echo 1.Sign in
echo 2.Register
echo 4.Exit
echo.
set /p input=What would you like to do:
if %input%==1 goto log
if %input%==2 goto reg
if %input%==4 goto exit
::changed this to 4, the menu suggested 4 without a goto.
goto menu

:reg
cls
color 0e
set /p user="Enter your desired username: "
set /p pass="Enter your desired password: "
echo %pass% >> %user%.txt
::changed this to set a text file with a password within.
goto menu

:log
set /p user="Enter your current username: "
set /p pass="Enter your current password: "
@echo on
set /p password=<%user%.txt
pause
@echo off
if %pass% equ %password% goto menu2
goto menu

:menu2
cls
color 0b
echo WELCOME!
echo.
echo 1.Sign in
echo 2.Options
echo 3.Exit
echo.
set /p input=What would you like to do?
if %input%==1 goto log2
if %input%==2 goto op
if %input%==3 goto exit
goto menu
:log2
echo there is no second log 2
goto menu
:op
echo there are no current options
goto menu
:exit
goto :eof

message edited by Sephierot


Report •

#3
September 21, 2014 at 06:47:57
Thank you for clarification... I'm not at all across programming - even anything more than a very basic batch file these days (if ever I was...) But others here who are much more experienced will likely/hopefully come across here and advise...

That you want to include "passwords" is a little??? Passwords are usually private and so on; although if you are storing them in their encrypted form (which means you and everyone else can't read them) perhaps OK?


Report •

Related Solutions

#4
September 21, 2014 at 07:11:30
thank you for your reply,for the password it's do not matter for i will use it only for our House network and NAS so i will just make the main folder with a attrib of +S and +H

Report •

#5
September 21, 2014 at 07:19:19
thank you for the reply,for the password it do not matter for i will just use it in my Home network and NAS i will just save it in a forder that have aattrib of +s and +h

Report •

#6
September 21, 2014 at 07:21:14
thank you for your reply,for the password it do not matter for i will just use it in my Home network and NAS i will just save the file in a folder that have a attrib of +s +h

Report •

#7
September 21, 2014 at 18:04:26
✔ Best Answer
I don't see what's not working in the code you posted, except for this line:
echo %pass% >> %user%.txt
which will append a space to the password. You want either of these:
>%user%.txt echo %pass%
OR
echo %pass%>%user%.txt
(also note the >> should be >)

If it was me, I would use the password to encrypt the username into either a random file, or a file named as username. Password is then verified by de-crypting the file and comparing the decrypted content with the entered username. There are many free encryptors available - PKZIP etc,


Report •

#8
September 21, 2014 at 21:15:34
the code work just fine,exempt for the part that you noted,i want that part to save the file in a folder in a location that i all ready have.

Report •

#9
September 23, 2014 at 18:24:32
at the top, put:
set allusers=c:\loc\that\already\have
...

then, after that, wherever it says "%user%.txt", substitute: "%allusers%\%user%.txt"


Report •

#10
September 23, 2014 at 23:17:24
thank you so much for this i will try it later, so the code will be like this(below)


title login
color 0b

@echo off
set allusers=c:\loc\that\already\have
:menu
cls
echo 1.Sign in
echo 2.Register
echo 4.Exit
echo.
set /p input=What would you like to do:
if %input%==1 goto log
if %input%==2 goto reg
if %input%==4 goto exit
::changed this to 4, the menu suggested 4 without a goto.
goto menu

:reg
cls
color 0e
set /p user="Enter your desired username: "
set /p pass="Enter your desired password: "
echo %pass% > %allusers%\%user%.txt
::changed this to set a text file with a password within.
goto menu

:log
set /p user="Enter your current username: "
set /p pass="Enter your current password: "
@echo on
set /p password=<%allusers%\%user%.txt
pause
@echo off
if %pass% equ %password% goto menu2
goto menu

:menu2
cls
color 0b
echo WELCOME!
echo.
echo 1.Sign in
echo 2.Options
echo 3.Exit
echo.
set /p input=What would you like to do?
if %input%==1 goto log2
if %input%==2 goto op
if %input%==3 goto exit
goto menu
:log2
echo there is no second log 2
goto menu
:op
echo there are no current options
goto menu
:exit
goto :eof


Report •


Ask Question