I think everyone agrees that DOS batch scripting is lame. Nonetheless there are many situations where it is expedient, or you must maintain existing scripts.
Guidelines:
- One feature per answer
- Give both a short description of the feature and an example, not just a link to documentation
- Limit answers to native funtionality, i.e., does not require additional software, like the Windows Resource Kit
Clarification: We refer here to scripts that are processed by cmd.exe, which is the default on WinNT variants.
(See also: Windows batch files: .bat vs .cmd?)