DOS is integrated in windows which allow to exploit functionality and command sequence in a script. A batch file is a text file containing command to be read by DOS. This file can be launched from the DOS or directly by double clicking from Windows.
Before creating the file, uncheck the box "Hide file extensions of the known types in the advanced options of Windows Explorer". Use a text editor that will save the file in plain text (notepad)
Open your text editor. Copy the command lines. Save your file with the extension. Txt (plain text) and close it. Click once on the filename and then press the F2 key: you're in "edit mode". Rename the file by replacing the .Txt .Bat(or .Cmd for recent OS). At the question: "Do you really want to rename the file?" click on "Yes".