How to Redirect Command Prompt Output to a File (Easy).
Then in XP one could add a comment to a file, (for almost any type of file in any folder), by right-clicking the file and selecting the properties option, then by selecting the summary tab one could type a comment and it was displayed in the comments field on the screen for the file.
The file write command can be used to write results or other information generated by Stata to a text file which can be read using a variety of programs found on most, if not all, computers. In the example below, we create a file containing descriptive statistics in a compact format, which can be read either by humans or as data by Stata or another program.
Recover files when command prompt does not help you Even though you can recover deleted files through Command Prompt but the prerequisite is that you must be familiar with technical jargons. The reason being, you have to type in many commands and if you’re not familiar with the command lines, then it may seem complicated.
Comments can explain what the do file does and why, and if anyone else ever needs to read and understand your do file they'll be very grateful for good comments. But you are the most likely beneficiary of your comments, when you have to figure out how your do file works months or years after writing it.