I want to write a batch file and we want to use if-then-else and for loop statements, but I don't know it and its option.
Please can anyone help me?
Microsoft usually has good information on their website. Here's info on batch files.
If you are looking to do anything relatively complex, you might be better of using something more modern than batch files.
There is also PowerShell, available for XP/2003 and above, which also has a far more expressive scripting featureset (though I've not got around to playing with PS myself, so I can't comment on how it compares to other options).
If you are familiar with unix-a-like systems you can transfer some of that knowledge by having something like