Batch codes for XP is an vast area it can be write your own ways/styles on notepad editor and run with out error. So kindly learn the below commands and batch codes. i written with explanation, i hope you can understand easily. if you have any doubt in blow batch code or your own codes please mail me i will recover your problem. Read carefully

@echo off --- display off in cmd windows ---
Title Batch Code for learning --- Title displays top of the windows ---
color yellow --- color is specify the font color ---
echo Choose any one --- Echo command used to display the word/sentence ---
:cal --- ':' is used to call function. it can call the defined word ---
set/p "o=*" --- Here 'o' i an variable and * is an display element in cmd windows ---
--- above method that is your create the choice on command windows batch file so u must design mutiple choice with option like below ---
echo a.Enter to New Command Windows
echo b.Exit from all command windows
--- above commands are just display the command windows panel ---
--- Next codes are assigned to function for above two option ---
if %o%==a goto opnnwcmd
--- If you are selected the option 'a' means above command call to the opnnwcmd, these opnnwcmd defined below as call function. See next command ---
if %o%==b goto extallcmd
--- if you are choose option 'b' means above command call to extallcmd function ---
--- Now we are moving to define the call functions ---
--- opnnwcmd call function ---
:opnnwcmd --- call funtion ---
cmd --- run command for open new cmd window ---
cls --- clear current command windows ---
:extallcmd --- another call function ---
kill /im cmd --- kill all cmd program immediatly ---
exit --- Exit current command window ---

Note: inside --- --- text are commands about correspoding batch code.

On above call funtion 1st call funtion run until 'cls' after terminate all commands, another thing is if we select second call funtion this will start from :extallcmd to exit after that all commands are terminated.

Above written batch code for learning purpose so i wrote with commands. below i will give batch code for without command for checking/testing the batch file in XP.

@echo off
Title Batch Code for learning
color yellow
echo Choose any one
echo a.Enter to New Command Windows
echo b.Exit from all command windows
set/p "o=*"
if %o%==a goto opnnwcmd
if %o%==b goto extallcmd
:opnnwcmd
cmd
cls
:extallcmd
kill /im cmd.exe
exit

0 comments