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

contact us

Posted by Malar | 3:48 AM

Please contact me if you have any doubt malarpullayannan@gmail.com

Can we run batch file as run/dos command?
Yes, we can run.All run commands/Dos command files such as copy(copy.exe) files are stored in system directory(Windows/system32). So if you want to run batch file as command just write new batch file and save it as system directory(Z:\Windows\ or Z:\Windows\System32. Here Z- Windows XP installed Directory). Now goto
Start>Run>* hit ENTER.
Note:*-Created batch file by you.
One of the Simple Example:
i write following batch code, if you want to check please copy below the code and paste notepad save as *.bat(*-any name) & save to system directory

here i want open the notepad on my system using different command such as note(here you must give file name note.bat)
Code:
@echo off
start notepad

Now you can run/cmd windows type opend & check it.

Above code can be written as following method also
@echo off
notepad
Now explain different between the above two codes are
On first Code command start the notepad and close immediatly, but on second code command windows are waiting until notepad closed.
Try this:
Before you try below batch code please read completly, this is not an virus it is loop program on batch file.
i used call the variable for loop function on batch file

@echo off
:a
start iexplore
goto a
Note: To stop above batch type on Run command kill /im iexplore
@echo off
:a
start cmd
goto a
Note: To stop above batch type on Run command kill /im cmd
If not working the above command means kill /im

Batch file for change Command windows Title, color and clear
@echo off
Title CHANGE THE WORLD WITH KNOWLEDGE
color 2
cls
exit

format and convert FAT/FAT32 to NTFS on Hard disk drive through batch file
@echo off
format /q /x /v:NEW DISK k:\
convert /v /fs:ntfs
exit
explain on format comment /q means quick format, /x means force to format the HD, /v refers Volume label i gave NEW DISK. k:\ - formatting HD drive.
Convert comment /v means verbose mode convert from FAT/FAT32 to NTFS

Some person asked can i run my .exe file through run/cmd windows if i placed that particular files on system directory?
Surly you can access your files on Run/cmd window if you are placed that .exe files on System Directory.Not only .exe(executable) file, we can run .bat(batch)file, .cmd(command)file, .cpl(control panel)file etc.,

Batch file also used change Date and time just on click
@echo off
Title Edit Date and Time -Author Malarpullayannan
:date1
echo Do you want to Edit Date?Press
echo 1.Yes
echo 2.No
set/p "op=>"
if %op%==1 goto YesEditDate
if %op%==2 goto NoEditDate
:YesEditDate
date
goto time1
:NoEditDate
goto time1
:time1
echo Do you want to Edit Time?Press
echo 1.Yes
echo 2.No
set/p "op=>"
if %op%==1 goto YesEditTime
if %op%==2 goto NoEditTime
:YesEditTime
time
goto menu1
:NoEditTime
goto menu1
:menu1
echo Do you want to Edit Date&Time?Press
echo 1.Yes
echo 2.No
set/p "op=>"
if %op%==1 goto YesEditDateTime
if %op%==2 goto NoEditDateTime
:YesEditDateTime
goto date1
:NoEditDateTime
exit

Try it. Thank you

Procedure to write the batch files:
There No specific procedure to write the batch files, it can be write your own way and your own knowledge. It also you can define some long command to write into single commands using batch files (see Complete batch Example and Procedure ).

Just you can write anything in batch file (Run and Dos commands). Now we just see some run/dos commands for batch file in XP.

explorer-- for open explorer on xp:: On batch file we just type explorer
like above method we can run following dos commands
eg:
iexplore

help

Note:No need to type extension for .exe files.

Batch Files are create with simple XP DOS command services. How can i write Batch code? These question has very simple answer is Notepad. Start Menu > Run > notepad Hit ENTER or Start Menu > Accessories > notepad.

First Step to Learn Batch on XP, How to Start XP Batch file on Windows XP?
Most of People familiar with echo command. now i will explain echo is an command it execute the Information. It just shows after you type echo command.

On Batch file echo on/off is the first step of batch file writing. Note: default is echo on.
So if you don want to show the run commands on command windows just type as @echo off

example:
Copy below batch codes to notepad and save as test.bat

@echo off
explorer

Hello,
This batch code for XP website will help to clarifying your doubts and learning tips about batch code. Normally batch files are create using notepad editor and save it as *.bat (*-any name you want). These batch files are accessed by windows XP kernal mode, most of the run command are used as batch code.
We will see many details about Batch code for XP. If you want ask any questions about .bat in XP send mail to malarpullayannan@gmail.com