Write in a batch file in text mode

December 2016

In the operating system MS-Dos, batch file represents a text file with commands that the command interpreter executes. In MS-Dos, batch files are used to automate and simplify routine or mundane tasks . Batch files have generally file name extensions such as .bat. To write a batch file in the text mode, the use of redirect is compulsory. The batch file in the text mode can be created by using the Echo command. WordPad is useful for saving the file, with the extension of the .bat carried out here.
  • To write in a batch file in text mode, you just have to use a redirect:

echo text > output_file.txt
  • To write in an existing file:
  • echo " Write at the end of the file ">> output_file.txt
    • Note: The accent will be copied to the DOS format.
  • You can use WordPad to address this problem:

Related :

This document entitled « Write in a batch file in text mode » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.