• alexb369 commented on radame's instructable 5 Cool Batch Files2 months ago
    5 Cool Batch Files

    Here Is A Modified Version Of "Password protect command prompt" :---------------------------------------------------------------------------------------------------------------title Log in to CMDcolor 07clsecho.echo Cmd Accountsecho =============echo.echo [1] Log Inecho [2] Sign Upecho [3] Exitecho.set /p op=if %op%==1 goto 1if %op%==2 goto 2if %op%==3 goto 3goto error:2clsecho Sign Upecho ======================================echo.set /p newname="Enter new username:"if "%newname%"=="%newname%" goto inputname:inputnamecd "%userprofile%\documents"if exist "cmdacoBin" goto skipif not exist "cmdacoBin" goto noskip:noskipmd "cmdacoBin"goto skip:skipcd "%userprofile%\documents\cmdacoBin"if exist "%newname%.bat" goto namexistif not exist "%newname%.bat" goto skip2:skip2echo set realusername=%newname%> "%newname%.bat"goto next:nextecho.set /p pswd=Enter new Password:if "%pswd%"=="%pswd%" goto inputpass:inputpasscd "%userprofile%\documents\cmdacoBin"echo set password=%pswd%>> "%newname%.bat"clsgoto chocls:choecho pick a color ( red green normal or special typed incorrectly will cause cmd to crash )set/p cc=color:if %cc%== red ECHO set col=0c> "%newname%color.bat"if %cc%== green ECHO set col=0a> "%newname%color.bat"if %cc%== normal ECHO set col=07> "%newname%color.bat"if %cc%== special ECHO set col=d3> "%newname%color.bat"goto next1:namexistecho.echo The entered username already exists.echo Press any key to return. . .pause >nulgoto 2:next1clsecho Cmd Accountsecho ============echo.echo Your account has been successfully created!echo.pausegoto home:1color 07clsecho Cmd Accounts Log Inecho ================================echo.Set /p logname=Username:if "%logname%"=="%logname%" goto 2.1:2.1echo.set /p logpass="Password:"if "%logpass%"=="%logpass%" goto login:logincd "%userprofile%\documents\cmdacoBin"if exist "%logname%.bat" goto callif not exist "%logname%.bat" goto errorlog:callcall "%logname%.bat"if "%password%"=="%logpass%" goto logdonegoto errorlog:errorlogcolor 0cecho.echo Username or Password incorrect.echo Access denied.pause >nulgoto home:logdoneclsecho Command Promptecho ==============echo.echo Successfully logged in!echo.pausegoto account:accountclscd "%userprofile%\documents\cmdacoBin"call "%realusername%color.bat"call "%realusername%.bat"color %colorcode%clsecho.echo -------------------------------------------------------------------------------echo %realusername%echo -------------------------------------------------------------------------------@echo offbreak offTitle Command Prompt:ssscall "%logname%color.bat"color %col%clsgoto cmdclsecho 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.pausecls:cmdecho Directory: %CD%set /P CMD=Command:if "%CMD%" == "cls" goto clsif "%CMD%" == "home" goto home2if "%CMD%" == "desktop" goto desktopif "%CMD%" == "red" goto redif "%CMD%" == "green" goto greenif "%CMD%" == "normal" goto normal%CMD%cd C:\goto cmd:clsclsgoto cmd:home2cd /d %USERPROFILE%clsgoto cmd:desktopcd /d %SystemDrive%\Users\%USERNAME%\Desktopclsgoto cmd:redcolor 0cclsgoto cmd:greencolor 0aclsgoto cmd:normalcolor 07clsgoto cmd

    `password generator remake:---------------------------------------------------------------------------------------------------------------@echo offclscolor 4ccls:loopclsgoto Start:Starttitle Password Generatorecho I generate you a new password.echo no need to write the password down it is in a text document!echo ----------------------------------------­-----------------------echo START PASSWORD GENERATOR!pauseclsgoto strtcls:strtclsecho what is the first word that pops in your head?set/p wrd=word:echo what is your name?set/p nam=name:clscd "%userprofile%\documents\Passwords"if exist "Passwords" goto ssif not exist "Passwords" goto m8ke:m8kemd Passwords:sscd "%userprofile%\documents\Passwords"echo %nam% your passwrod generated is this number %random%> %wrd%.txtecho Your password is saved as a txt fileecho Now choose what you want to do.echo 1) Go back to the beginningecho 2) Exitset input=set /p input= Choice:clsif %input% == 1 goto loop if %input% == 2 Exitclsgoto loopcls

    View Instructable »