
James G. answered 07/26/17
Tutor
4.9
(1,012)
Skilled at programming and problem solving
Batch files need to be documented for the same reasons as any other code:
1. Explain what it does. Using code without knowing what it does can be dangerous.
2. Explain how your code works. What may seem clear when code is written, may not be when it is time to change, or fix your code.
You can add help information to a batch files, see https://stackoverflow.com/questions/8179425/adding-switch-in-batch. This is a good way to provide information about what the batch file does.
The "rem" command will allow comments to be embedded in a batch file, see https://stackoverflow.com/questions/12407800/which-comment-style-should-i-use-in-batch-files, this is a good way to provide information about how a batch file works.