Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :init
- color 0b
- cls
- title Main Menu - Messenger
- :menu
- echo 1. Log in
- echo ------------------------------
- echo 2. Create an Account
- echo ------------------------------
- echo 3. Change your Password
- echo ------------------------------
- echo 4. Change your Username
- echo ------------------------------
- echo 5. Exit
- echo.
- set /p cho=Choice Number:
- if %cho% == 1 goto login
- if %cho% == 2 goto register
- if %cho% == 3 goto changepass
- if %cho% == 4 goto changeuser
- if %cho% == 5 exit
- color 0c
- echo Please enter a valid number.
- ping localhost -n 2 >nul
- goto init
- :login
- cls
- color 0d
- title Log In - Messenger
- set /p user=User Name:
- if not exist \\DUJEMC-PC\Users\Public\Chat\Users\%user%.unfile goto noacc
- echo ------------------------------
- set /p pass=Password:
- echo %pass%>%tmp%\chtmp.tmp
- fc "%tmp%\chtmp.tmp" "\\DUJEMC-PC\Users\Public\Chat\Users\%user%.unfile" >nul
- if errorlevel==1 goto incor
- cls
- echo Connecting to chat room...
- ping localhost -n 3 >nul
- goto chat
- :noacc
- cls
- color 0c
- echo The account does not exist. Please create an account.
- ping localhost -n 3 >nul
- goto init
- :incor
- cls
- color 0c
- echo The password is incorrect. Please try again.
- ping localhost -n 3 >nul
- goto login
- :register
- cls
- color 4f
- title Register - Messenger
- set /p user=User Name:
- echo ------------------------------
- set /p pass=Password:
- echo %pass%>\\DUJEMC-PC\Users\Public\Chat\Users\%user%.unfile
- echo Account created successfully with the following password: %pass%! Now you can use that data to access the chat.
- ping localhost -n 3 >nul
- goto init
- :changepass
- :changeuser
- :chat
- cls
- color 0a
- title Chat - Messenger
- set name=%user%
- start \\DUJEMC-PC\Users\Public\Chat\Program_Files\msgbox.cmd
- :chat2
- cls
- color 0a
- set /p text=Text:
- goto send
- :send
- echo %name%:%text%>>\\DUJEMC-PC\Users\Public\Chat\Program_Files\chatroom.chatfile
- goto chat2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement