r/Batch • u/Rubiktor012 • Nov 15 '19
MS-DOS Batch-Based Operative System
Here's my OS, based on the one made by prof. hacker 6661 (youtu.be/C_1-xoOGtno)
@echo off
color 1b
cls
:select
cls
color 1b
echo 1)Admin Login!
echo 2)Guest login!
set /p logintype=
if %logintype% == 1 goto bootscreen
if %logintype% == 2 goto ltddesktop
:bootscreen
cls
set /p password= Password:
if %password% == pass goto desktop
if not %password% == pass goto bootscreentwo
goto bootscreen
:desktop
cls
color 0a
cls
echo Welcome Admin.
echo.
echo Date: %date% Time: %time%
echo Here are your options in your own OS!!:
echo 1)Write text file.
echo 2)Documents...
echo 3)Calculator...
echo 4)Antivirus.
echo 5)Log off.
set /p menuselect=
if %menuselect% == 1 goto write
if %menuselect% == 2 goto browse
if %menuselect% == 3 goto calculator
if %menuselect% == 4 goto antivirus
if %menuselect% == 5 goto select
:write
cls
echo Welcome to Write, an application which let's you write text files...
echo What slot you want to use? (1-3)
set /p file=
if %file% == 1 set name= writeone
if %file% == 1 set file= textone
if %file% == 2 set name= writetwo
if %file% == 2 set file= texttwo
if %file% == 3 set name= writethree
if %file% == 3 set file= textthree
cls
echo What will be the name of your text?
set /p %name%= Name:
cls
echo Ok, your file has been created. Have fun!
pause
cls
set /p %file%=
pause
echo Ok, now your done, you will be redirected to the desktop...
pause
goto desktop
:calculator
cls
set /p equ=
set /a equ=%equ%
cls
echo %equ%
pause
goto desktop
:browse
cls
echo 1)%writeone%
echo 2)%writetwo%
echo 3)%writethree%
set /p browse=
if %browse% == 1 goto textone
if %browse% == 2 goto texttwo
if %browse% == 3 goto textthree
:textone
cls
echo %writeone%
echo %textone%
pause
goto desktop
:texttwo
cls
echo %writetwo%
echo %texttwo%
pause
goto desktop
:textthree
cls
echo %writethree%
echo %textthree%
pause
goto desktop
:antivirus
cls
color 07
echo Antivirus
echo created by Rubiktor012
echo press any key to scan...
pause>nul
:start
IF EXIST virus.bat goto infected
IF NOT EXIST virus.bat goto clean
cd C:Windowssystem32
:infected
color 0c
echo WARNING VIRUS DETECTED!
del virus.bat
pause
goto start
:clean
color 0a
echo System secure!
pause
goto desktop
:bootscreentwo
cls
echo ~That was the wrong password~
echo 1)Admin Login!
echo 2)Guest login!
set /p logintype=
if %logintype% == 1 goto bootscreen
if %logintype% == 2 goto ltddesktop
:ltddesktop
color 1b
cls
echo Hello there, you are logged in as a guest, you do not have permission to create or browse through text files...
echo.
echo You can use the standard tools such as: The calculator, the clock and the Antivirus...
echo.
echo Have fun!
pause
:guest
color 1b
cls
echo 1)Calculator!
echo 2)Clock
echo 3)Antivirus
echo 4)Log off.
set /p ltdmenu=
if %ltdmenu% == 1 goto ltdcalculator
if %ltdmenu% == 2 goto clock
if %ltdmenu% == 3 goto ltdantivirus
if %ltdmenu% == 4 goto select
:clock
cls
echo %date% %time%
pause
goto guest
:ltdcalculator
cls
set /p equ=
set /a equ=%equ%
cls
echo %equ%
pause
goto guest
goto guest
:ltdantivirus
cls
color 7f
echo Antivirus
echo created by Rubiktor012
echo press any key to scan...
pause>nul
:ltdstart
IF EXIST virus.bat goto ltdinfected
IF NOT EXIST virus.bat goto ltdclean
cd C:Windowssystem32
:ltdinfected
color 4c
echo WARNING VIRUS DETECTED!
del virus.bat
pause
goto ltdstart
:ltdclean
color 2a
echo System secure!
pause
goto guest
The Admin. password is pass in lower-case
2
u/Lightning3240 Nov 16 '19
I posted mine before you posted yours
>:3
Anyways, good job! I like your ideas.