Author Topic: My coolest Batch file EVER!  (Read 2383 times)

Even though theres a calculator tool, I thought it would be cool to make my own. It only does simple things like First Number + Second Number, so you can't add on, but personally I think it's cool.
To try it out copy and paste the following on notepad, and click SaveAs and name it "Something.bat"
Oh and my real name is Joseph Wilson :P
----------------------------------------------------------------------------------------------------------------------------------
@echo off
title Calculator
color 0f
goto Title
:Main
cls
echo Invalid command, only use the number
pause >nul
:Title
cls
echo -------------------------------------
echo - Calculator                           -
echo - By Joseph wilson AKA Allath-
echo -------------------------------------
echo 1) Addition
echo 2) Subraction
echo 3) Division
echo 4) Mulitplication
set /pm=:
if %m%== 1 goto Add
if %m%== 2 goto Sub
if %m%== 3 goto Div
if %m%== 4 goto Mul
goto Main
:Add
cls
echo First Number + Second Number
Set /p A1=First Number:
set /p A2=Second Number:
set /A sum=%A1% + %A2%
Echo %A1% + %A2% = %Sum%
Pause>nul
goto Title
:Sub
cls
echo First Number - Second Number
Set /p B1=First Number:
set /p B2=Second Number:
set /A sum=%B1% - %B2%
Echo %B1% - %B2% = %Sum%
Pause>nul
goto Title
:Div
cls
echo First Number / Second Number
Set /p B1=First Number:
set /p B2=Second Number:
set /A sum=%B1% / %B2%
Echo %B1% / %B2% = %Sum%
Pause>nul
goto Title
:Mul
cls
echo First Number * Second Number
Set /p B1=First Number:
set /p B2=Second Number:
set /A sum=%B1% * %B2%
Echo %B1% * %B2% = %Sum%
Pause>nul
goto Title


I thought this was going to be a sys 32 deleting batch file...
Also this is kinda culbro, you should add more features.

I can do all of that in two lines:
Code: [Select]
title Calculator
start calc

I'm thinking about it, my friend wants me to make one that solves Algebraic expressions. that one hurt my brain though :/

Turns out theres an easier way to do all of that :/

Updates!
@echo off
title Calculator
color 0f
goto Title
:Main
cls
echo Invalid command, only use the number
pause >nul
:Title
cls
echo --------------------
echo - Calculator       -
echo - By Joseph wilson -
echo --------------------
echo 1) Addition
echo 2) Subraction
echo 3) Division
echo 4) Mulitplication
echo 5) Custom
set /pm=:
if %m%== 1 goto Add
if %m%== 2 goto Sub
if %m%== 3 goto Div
if %m%== 4 goto Mul
if %m%== 5 goto Cus
goto Main
:Add
cls
echo First Number + Second Number
Set /p A1=First Number:
set /p A2=Second Number:
set /A sum=%A1% + %A2%
Echo %A1% + %A2% = %Sum%
Pause>nul
goto Title
:Sub
cls
echo First Number - Second Number
Set /p B1=First Number:
set /p B2=Second Number:
set /A sum=%B1% - %B2%
Echo %B1% - %B2% = %Sum%
Pause>nul
goto Title
:Div
cls
echo First Number / Second Number
Set /p B1=First Number:
set /p B2=Second Number:
set /A sum=%B1% / %B2%
Echo %B1% / %B2% = %Sum%
Pause>nul
goto Title
:Mul
cls
echo First Number * Second Number
Set /p B1=First Number:
set /p B2=Second Number:
set /A sum=%B1% * %B2%
Echo %B1% * %B2% = %Sum%
Pause>nul
goto Title
:Cus
cls
set /p equation=Equation:
set /a ans= %equation%
echo Answer: %ans%
pause > Nul
goto Title


I can do all of that in two lines:
Code: [Select]
title Calculator
start calc

I can do that in ONE line.

Code: [Select]
start calc
Hurp :3


I can do that in ONE line.

Code: [Select]
start calc
Hurp :3
guess what, i can do it in zero. all you gotta do is go to start>programs>accessories>calculator

guess what, i can do it in zero. all you gotta do is go to start>programs>accessories>calculator
I can do it with no computer.


I can do it with time paradox.

make more useful batch files please