Write an article based on this "Open Notepad Learn some basic batch commands. Write a program to create a directory. Write the code to make a basic backup program. Display some text. Experiment with different batch commands."
. Notepad allows you to create code as a text file and then save it when you're done as a batch file. You can open Notepad by opening Start {"smallUrl":"https:\/\/www.wikihow.com\/images\/0\/07\/Windowsstart.png","bigUrl":"\/images\/thumb\/0\/07\/Windowsstart.png\/30px-Windowsstart.png","smallWidth":460,"smallHeight":460,"bigWidth":"30","bigHeight":"30","licensing":"<div class="mw-parser-output"><p>I edited this screenshot of a Windows icon.
<\/p><p>License: <a rel="nofollow" class="external text" href="http:\/\/en.wikipedia.org\/wiki\/Public_domain">Public Domain<\/a><br>
<\/p><\/div>"}, typing in Notepad, and clicking the blue Notepad app icon at the top of the menu. Notepad is commonly used to convert text files into batch files, but you can write your batch file's text virtually anywhere. Batch files run a series of DOS commands, so the commands that you can use are similar to DOS commands. Some of the more important ones include: ECHO - Displays text on the screen @ECHO OFF - Hides the text that is normally output START - Run a file with its default application REM - Inserts a comment line in the program MKDIR/RMDIR - Create and remove directories DEL - Deletes a file or files COPY - Copy a file or files XCOPY - Allows you to copy files with extra options FOR/IN/DO - This command lets you specify files. TITLE- Edit the title of the window. One of the easiest ways to learn how to create batch files is to focus on doing basic tasks first. For example, you can use a batch file to quickly create multiple directories: MKDIR c:\example1 MKDIR c:\example2 Batch files are great for running multiple commands, especially if you configure it to be able to run multiple times. With the XCOPY command, you can make a batch file that copies files from select folders to a backup folder, only overwriting files that have been updated since the last copy: @ECHO OFF XCOPY c:\original c:ackupfolder /m /e /y This copies over files from the folder "original" to the folder "backupfolder". You can replace these with the paths to the folders you want. /m specifies that only updated files will be copied, /e specifies that all subdirectories in the listed directory will be copied, and /y keeps the confirmation message appearing every time a file is overwritten. If you want to know what is happening in your batch file but don't want to see all the commands, you could program the batch file to print some text that explains what the batch file does. You can print text with ECHO. For example: @ECHO OFF MKDIR c:\example1 ECHO Created directory example1 You can change the color of the output with COLOR bf, where b is the background and f is the foreground color, both a hexadecimal number. Following colors are possible: Number Color Number Color 0 black 8 dark grey 1 dark blue 9 blue 2 dark green a green 3 dark turquoise b turquoise 4 dark red c red 5 dark magenta d magenta 6 dark yellow e yellow 7 light grey f white For example, red text on a dark green background would be displayed with COLOR 2c You need run the batch file from the command line to see the text, because else the window will close too fast to actually read the text you printed. If you want inspiration, you can check out the sample batch text at the end of this article.