EASY BATCH FILE

3,343

7

2

Posted

Introduction: EASY BATCH FILE

This is how to make a simple batch file.

Step 1:

OPEN NOTEPAD.

Step 2:

TYPE IN THE FOLLOWING:
@echo off
title MY PROGRAM
color a
echo WELCOME
echo.
echo 1.)START
echo 2.)EXIT
echo.
set /p var=YOUR CHOICE:
if %var%==1 goto HELLO
if %var%==2 exit
:HELLO
cls
echo PLEASE CHOOSE AN OPTION
echo.
echo 1.)OPEN GOOGLE
echo 2.)OPEN EMAIL
echo 3.)SHUTDOWN COMPUTER
echo 4.)EXIT
echo.
set /p var=YOUR CHOICE:
if %var%==1 start www.google.com
if %var%==2 start www.gmail.com
if %var%==3 shutdown -s
if %var%==4 exit
pause
exit

Step 3:

Save as program.bat

Share

    Recommendations

    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Microcontroller Contest

      Microcontroller Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    2 Comments

    I'm not being rude, but you made 2 mistakes:

    1. You should put a else statement after choices

    2. Who needs to shutdown their computer through a batch file?

    This program works, but you may want to add an else statement after the choices. Currently if you enter a 3 in the first choice then it goes to :HELLO