how to create a batch file - basics

Diese Seite gibt es auch in Deutsch

A simple batch file is a text file containing a set of command prompt commands. A simple editor is sufficient to create the batch file. A text file saved in Windows/DOS with the extension .cmd or .bat, can be executed directly. Especially for very simple processes, for example copying files or folders, batch files may still be easier than using PowerShell. At the latest, if commands should not be executed in sequence and certain if-queries, loops or functions are necessary, I would recommend the use of PowerShell.

Create a Batch-File

A new batch file can be created in any editor. .cmd or .bat should be used as the file extension. In the Windows editor, the file name should be placed under quotation marks so that “batchfile.cmd.txt” is not saved as the extension, but “batchfile.cmd”:



Batch commands are then written to the file in a separate line each time. When executing the file (double click) the lines are processed one after the other.
A right click “edit” opens the editor again to edit the file.

See also: Structure of a Batch File Syntax

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!



Questions / Comments