0 Users appreciate this thread.
Log-In System [BATCH]
sillyface (2013-01-06 08:17:04)Thanks guys

CoolApps (2013-01-08 22:35:46)The problem is that some parts of the code is replaced with icons, it is recommend to upload this to a website so you can download the batch script.
I assume that it should be ':' where desktop and skip properties are.
2013-01-08 22:37:50
Newer account: NodePoint
CoolApps (2013-01-08 22:38:28)I assume ':' is suppose to be with skip and desktop.
Newer account: NodePoint
LincolnN9neN9ne (2013-05-15 00:54:57)Sign up doesn't work.
[IMG]http://i.imgur.com/JUs6LzU.jpg[/IMG]
Log in to submit a comment
Back to forum: Programming (Python, Java, Delphi/Pascal, C, VB, etc)
New registered users today: 7
Newest registered user: ElegantVulpes
(If you like this, please press the appreciate button above.)
Hello!
This is how to make a log-in system in Batch.
1. Open Notepad (on Windows).
2. Paste this in:
@echo off
:home
title Log in to CMD
color 07
cls
echo.
echo Cmd Accounts
echo =============
echo.
echo [1] Log In
echo [2] Sign Up
echo [3] Exit
echo.
set /p op=
if %op%==1 goto 1
if %op%==2 goto 2
if %op%==3 goto 3
goto error
:2
cls
echo Sign Up
echo ======================================
echo.
set /p newname="Enter new username:"
if "%newname%"=="%newname%" goto inputname
:inputname
cd "%userprofile%\documents"
if exist "cmdacoBin" goto skip
if not exist "cmdacoBin" goto noskip
:noskip
md "cmdacoBin"
goto skip
cd "%userprofile%\documents\cmdacoBin"
if exist "user/%newname%.bat" goto namexist
if not exist "user/%newname%.bat" goto skip2
echo set realusername=%newname%> "user/%newname%.bat"
goto next
:next
echo.
set /p pswd=Enter new Password:
if "%pswd%"=="%pswd%" goto inputpass
:inputpass
cd "%userprofile%\documents\cmdacoBin"
echo set password=%pswd%>> "user/%newname%.bat"
goto next1
:namexist
echo.
echo The entered username already exists.
echo Press any key to return. . .
pause >nul
goto 2
:next1
cls
echo Cmd Accounts
echo ============
echo.
echo Your account has been successfully created!
echo.
pause
goto home
:1
color 07
cls
echo Cmd Accounts Log In
echo ================================
echo.
Set /p logname=Username:
if "%logname%"=="%logname%" goto 2.1
:2.1
echo.
set /p logpass="Password:"
if "%logpass%"=="%logpass%" goto login
:login
cd "%userprofile%\documents\cmdacoBin"
if exist "user/%logname%.bat" goto call
if not exist "user/%logname%.bat" goto errorlog
:call
call "user/%logname%.bat"
if "%password%"=="%logpass%" goto logdone
goto errorlog
:errorlog
color 0c
echo.
echo Username or Password incorrect.
echo Access denied.
pause >nul
goto home
:logdone
cls
echo Command Prompt
echo ==============
echo.
echo Successfully logged in!
echo.
pause
goto account
:account
cls
cd "%userprofile%\documents\cmdacoBin"
call "%realusername%color.bat"
call "%realusername%.bat"
color %colorcode%
cls
echo.
echo -------------------------------------------------------------------------------
echo %realusername%
echo -------------------------------------------------------------------------------
@echo off
break off
Title Command Prompt
color 0a
cls
echo Type "home" any time to go to the current user profile directory.
echo Type "desktop" any time to go to the current user desktop.
echo.
echo Type help to see list of common commands like cd, rd, md, del,
echo ren, replace, copy, xcopy, move, attrib, tree, edit, and cls.
echo Type [command]/? for detailed info.
echo.
pause
cls
:cmd
echo Directory: %CD%
set /P CMD=Command:
if "%CMD%" == "cls" goto cls
if "%CMD%" == "home" goto home2
if "%CMD%" == "desktop" goto desktop
if "%CMD%" == "red" goto red
if "%CMD%" == "green" goto green
if "%CMD%" == "normal" goto normal
%CMD%
cd C:\
goto cmd
:cls
cls
goto cmd
:home2
cd /d %USERPROFILE%
cls
goto cmd
cd /d %SystemDrive%\Users\%USERNAME%\Desktop
cls
goto cmd
:red
color 0c
cls
goto cmd
:green
color 0a
cls
goto cmd
:normal
color 07
cls
goto cmd
3. Click File > Save As...
4. In the name type in Whatever.BAT (keep the .BAT) and on the Save as type select All Files.
5. Hit the Save button
6. You're Done!
If this worked, please leave a reply!
If you need more help, PM me.
Thanks, Sillyface
EDIT: NOTE, this will make some folders where you save it. DON'T DELETE THEM!
2013-01-06 08:20:10