Batch Files

Batch Files

Sections: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Index | Next >

Working with a Text Editor

Learning objective: (2) Explain how to create a batch file with an text editor in Windows


Click on image to enlarge.

You will most likely need to use a Windows text editor like Notepad or Notepad2 to create a batch file. See link for Notepad2. It is a free portable app and the notes at the bottom of the page for downloading and using. Notepad2 does not require admin permission to use on the desktop or portable storage device like a USB drive.

Why use a Text Editor?

There are important differences between plain text files created by a text editor and document files created by word processors such as Microsoft Word and WordPerfect. A plain text file uses a simple character set such as ASCII to represent numbers, letters, and a small number of symbols. The only non-printing characters in the file that can be used to format the text are spaces, tabs, and newlines. Word processor documents generally contain formatted text, such as enabling text to appear in boldface and italics, to use multiple fonts, and to be structured into columns and tables. These capabilities were once associated only with desktop publishing, but are now available in the simplest word processor. [Wikipedia]

Syntax highlighting

Syntax highlighting contextually highlights software code and other text that appears in an organized or predictable format. (Check your editor for managing these options.) [Wikipedia]

Text formatting

Text editors often provide basic formatting features like line wrap, auto-indentation, bullet list formatting, comment formatting, syntax highlighting and so on. (Check your editor for managing these options.) [Wikipedia]

UTF-8 encoding ~= ASCII

The first 128 characters of Unicode, which correspond one-to-one with ASCII, are encoded using a single octet with the same binary value as ASCII, making valid ASCII text valid UTF-8-encoded Unicode as well. (Check your editor for managing these options.) [Wikipedia]

Newline issue

In computing, a newline, also known as a line ending, end of line (EOL), or line break, is a special character or sequence of characters signifying the end of a line of text. The actual codes representing a newline vary across operating systems, which can be a problem when exchanging text files between systems with different newline representations. The different newline conventions often cause text files that have been transferred between systems of different types to be displayed incorrectly. For example, files originating on Unix or Apple Macintosh systems may appear as a single long line on some Windows programs. Conversely, when viewing a file originating from a Windows computer on a Unix system, the extra CR may be displayed as ^M or cr at the end of each line or as a second line break. (Check your editor for managing these options.) [Wikipedia]

Thinking: Why use a text editor and not the basic Notepad that comes with Windows?

Key terms: ASCII, UTF-8, newline, syntax highlighting, text editor

Resources:
To maximize your learning, please visit these Web sites and review their content to help reinforce the concepts presented in this section.

Quick links:
Text Editor @ Wikipedia
Comparison of Text Editors @ Wikipedia
Newline in documents @ Wikipedia
Notepad2 @ portableapps.com

Embedded Resources

Notes on navigation: Click inside the frame to navigate the embedded Web page. - Click outside the frame to navigate this page to scroll up/down between the embedded Web pages. - Click on the frame title to open that page in a new tab in most browsers. - Click on the the "Reload page" link to reload the original page for that frame.

Text Editor @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Comparison of Text Editors @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Newline in documents @ Wikipedia | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Notepad2 @ portableapps.com | Reload page | If frame is empty, click on the link to view the page in a new tab or window

Sections: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Index | Next >