Command Line Interpreter instructions
What are these DOS commands?
The Disk Operating System (DOS) is actually a set of software interrupts in machine
language that resides on the first part of a disk drive. Its loaded with a boot
loader and used to create application programs using these DOS interrupts. DOS
then talks to the processor in its own unique machine language. DOS is a very
powerful processor instruction set, wrapped up in its own shell.
The so called DOS script we use are application programs that interpret our native
language instructions from the keyboard or some other source like a BATCH file and
then they use DOS to instruct the processor appropriately in its own machine language.
There are a number of these SCRIPT interpreters. COMMAND.COM and CMD.EXE ordinarily
come with our Windows System.
Our efforts here are to learn how to use the appropriate script that these interprets
recognize to perform tasks that the DOS was designed to perform. We can enter this
script either from the keyboard (using command.com or CMD.EXE) or by calling a BATCH
file using Window's mouse click, Window's RUN function or calling it with another
program. All of these methods will break the DOS shell and permit us access to its
power to control the processor.
Where can I find these DOS commands?
The DOS interpreter had for-seen the need to remind programmers what commands are
available. There are several ways to get help on this subject, built right into
the Interpreter. Firstly, help may be provided by using the command HELP .
For now, we will see some of the things we can do with the HELP instruction.
We learned earlier how to create a batch file on the desktop. Our intent is to use
it to make a hard copy folder with information to use in creating batch files. Make
a bat file to display the Command Interpreter's Help file. Then develope it until
it does what we wish.
Copy and Paste this bat stream into a file named Temp.bat on the desktop.
echo off
cls
echo Command Interpreter Instruction Set
help
help > temp.txt
pause
This bat stream will output the line of text following the echo instruction.
Then it will echo the help instruction with o argument to the default output device.
The next help instruction will re-direct the output to a file named TEMP.TXT
The PAUSE instruction halts the bat stream until any key is pressed.
Unless your printer is connected to the old LPT parallel port, the PRINT
command will not print your text file using older application programs. The newer
printers want their commands and data from the USB ports instead. Fortunatey, the
NOTEPAD and the WORDPAD programs both recognize the /p switch
and have suitable printer drivers to allow us to access them. This is a method to
access these applications using out scripting.
echo This bat string uses NOTEPAD to print this message > temp.txt
notepad /p temp.txt
Printing a text file.
This bat string will create a text file containing three lines of text, output
it into a text file, print it and finally delete the temperary text file.
echo put this into a text file > temp.txt
echo output it to a text file >> temp.txt
echo print the text file >> temp.txt
echo finally delete the text file >> temp.txt
notepad /p temp.txt
del temp.txt