Document 11475660

advertisement
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 5
Internal Commands – COPY and TYPE
Chapter 5
Internal Commands — Copy and Type
LECTURE NOTES
CHAPTER OUTLINE
TEACHING SUGGESTIONS
Chapter Overview
 Slides 2-7


 Chapter Overview duplicated in




Will review file-naming rules.
Will learn some internal commands that can be
used to manage and manipulate files.
The value of creating and using dummy files will
be explained.
Will experience naming, managing, manipulating,
viewing, and printing files.
Will use COPY and TYPE commands to perform
various tasks.
Both concatenation and the consequences of
overwriting files will be discussed.
WHY LEARN COMMAND LINE COMMANDS?
 Why Learn Command Line Commands?
 Quick review of directory management
commands.
 MD - make directory.
 CD - display current directory and path.
 RD - remove a directory/subdirectory.
 Directories.
 Largest unit of information management.
 Used to organize program and data files.
 File level.
 Place to manage information in smaller
quantities (housekeeping tasks).
 Copying files from one directory or one
disk to another.
 Eliminating files no longer needed.
 Housekeeping tasks different from
creating/changing data within file.
 Must use application program that
created data file to change data in file.
PowerPoint slides.
 After completion of lecture, suggest to
students that they review Objectives
and Outcomes found on first page of
chapter as a check to see if they have
mastered concepts.
SECTION 5.1 (pp.185-186)

Slides 8-13
 Discuss function/purpose of internal
commands.
- Once system booted, they stay in
memory and are available for use until
computer turned off.
- Used to manipulate files.
- - Manipulating files is different than
creating or changing data in files.
- Deal with files as objects – not
dealing with contents of files.
- Used to manipulate files.

Discussion Question (1) - Explain the
function and purpose of internal
commands.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 1
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems



Chapter 5
Internal Commands – COPY and TYPE
Managing files.
 In Windows use Explorer and My
Computer to manage files.
 Learn command line to understand:
 File manipulation.
 Disk and subdirectory structure.
Some tasks done easier/faster at command line.
 Copy and rename file takes 2 steps at GUI.
Only 1 step at command line.
Internal commands that help manage files.
 DIR - see what files are on disk.
 COPY - make copies of files.
 RENAME - change names of files.
 DEL - eliminate files.
 TYPE - display contents of files.
THE COPY COMMAND
 The COPY Command
 Internal command.
 Makes identical copy of file (source file) and
places file where you want it (destination).
 Reasons for copying files:
 Copy from one disk to another.
 Used as backup in case something goes
wrong
 Copy file from one computer to another
 Make second copy to existing file on same
disk.
 Copy file to device.
 If device printer – must be ASCII file.
 Making changes of existing file with
program that created it – if you don’t like
changes can go back to original.
 Cannot have two files with same
name in same directory but can
have them in different directories.
 Use OS to perform housekeeping
tasks – rather than creating copies
in application package - do it at OS
level.
SECTION 5.2 (pp. 186-187)

Slides 14-17
 Copying file does not alter original.
 Selectively copy files instead of entire






disks.
For each method of copying files give
reasons/examples of why done.
ASCII file - File contains no “codes”
such as bold or italic.
Copy (command), source (file to be
copied), and destination (where copied
to) are all mandatory.
Drive and path do not need to be
specified in using default drive and
subdirectory.
Discussion Question (2) - Give two
reasons for making a copy of a file on the
same disk.
Discussion Question (3) - Give the syntax
for the COPY command and explain each
part of the syntax.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 2
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems

Chapter 5
Internal Commands – COPY and TYPE
COPY syntax:
COPY [drive:] [path] filename [drive:] [path]
filename

- Conceptually - COPY source destination.
 [drive:] - where file is located.
 [path] - subdirectory where file is located.
 Filename - name of file to be copied.
- OS prior to Windows 95 no spaces
between file name and file extension.
- In Windows, LFN must be enclosed in
quotes.
WUGXP subdirectory contains practice data
files that you will work with so that you do not
have to worry about harming your "real"
program or "real" data files.
REVIEW OF FILE-NAMING RULES
 Review of File-naming Rules
 File name (file specification) has two parts.
 File name.
 File specification.
 File naming rules – PowerPoint slides.
 Names of files in a directory must be
unique.
 No file name can be longer than 255
characters, including the file extension.
 File extensions are optional.
 File name separated from its extension with
a period, called a dot.
 All alphanumeric characters can be used in
file names and file extensions except the
following (illegal or forbidden) characters:
 " / \ : | < > * ?
 Program files.
 Usually do not name program files - names
are assigned by a programmer.
 Commonly have file extension of .COM,
.EXE, or .BAT.
 Will be naming data files.
 Use names that reflect file contents.
 Extensions usually specify type of file.

Some application programs will assign a
file extension automatically to their data
files.
SECTION 5.3 (pp. 187-188)

Slides 18-21
 File specifications are file name and
file extension.
 When naming files, file names refer to
what data is in the file, and file
extension refers to type of data in the
file.
 Most application programs assign file
extensions.
 Note that file extensions are not
interchangeable.




Discussion Question (4) - Is a file
extension mandatory when naming a file?
Discussion Question (5) - What is the
maximum number of characters that may
used when naming a file?
Discussion Question (6) - List three
characters that cannot be used when
naming files.
Discussion Question (7) - List three
examples of legal file names.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 3
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
ACTIVITY—MAKING COPIES OF FILES
 Making Copies of Files
 DATA disk in Drive A.
 Open a Command Prompt window C:\> is
displayed.
 WUGXP directory with files on hard disk.
 Activity steps.
 Key in:










CD \WUGXP
DIR *.TMP
COPY C:\WUGXP\JUP.TMP A:JUP.TMP
DIR A:
COPY MER.TMP
COPY AST.TMP
COPYVEN.TMP
DIR A:
COPY AST.TMP A:\ASTROLOGY.FIL
DIR A:

Activity completed.
USING LONG FILE NAMES
 Using Long File Names
 Can be used when using floppy disk.
 Use only when really necessary.
 Directory entry table has room for 224
files.
 Floppy disks use old FAT16 file system.
 Disks designed to hold files that complied
with 8.3 rule.
 Once directory entry table filled cannot
place any other files on disk (even if room).
 Compare two directory entry tables - Figure 5.1
Two Directory Entry Tables – See PowerPoint.
 Amt. of space data utilizes same – space in
root directory varies.
 At command line enclose entire file
specification in quotes if file name has spaces.
 To see short and long name in directory listing
use /X parameter with DIR.
 Discuss Figure 5.2 Directory Listing Showing
Short and Long File Names – See PowerPoint.
 Discuss alias.
 Digit assigned by OS.
 Discuss Sandya~1 etc.
 Digits assigned on first come basis.
Chapter 5
Internal Commands – COPY and TYPE
SECTION 5.4 (pp. 188-191)
 Slides 22-23
 Note: Check Configuration Table in
Chapter 1.6 if system configuration
varies from text.
 Function keys correct typographical
errors – See Chapter 2 for details.
 In this case, used absolute path for both
source file and destination file.

Dot (.) not space separates file name from
file extension - not part of file
specification.
 In Windows Explorer or My Computer
cannot copy and rename files with one
command.
- Must copy files then rename each one.
 Command line can copy and give files
new name in one command.
SECTION 5.5 (pp.191-192)

Slides 24-29
 On root of floppy disk can only save




212 files/subdirectory names.
Explain how alias (eight dot three)
name is created.
Viewing file names on MS-DOS
Screen.
- Two listings
- - Name 8.3 rule – both names the
same.
- - LFN (right) - 8.3 (left)
At command line LFN enclosed in
quotes.
Explain why LFN helpful in order to
have meaningful unique characters
within first six characters of name.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 4
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
ACTIVITY—COPYING FILES WITH LONG
FILE NAMES
 Copying Files with Long File Names
 Activity steps.
 Key in:


SECTION 5.6 (pp. 192-193)

Slide 30
COPY “SANDY AND NICKI. TXT" A:
DIR A: /X

Activity completed.
USING WILDCARDS WITH THE COPY
COMMAND
 Using Wildcards with the COPY Command
 Wildcards - the * and ?.
 Known as global file specifications.
 Use with DIR to display a group of files.
 Use with COPY to copy files on same disk.
 Can be used to change destination name.
 Remember that:
 ? replaces 1 character.
 * replaces any number of characters.
ACTIVITY—USING WILDCARDS WITH THE
COPY COMMAND
 Using Wildcards with the COPY Command
 DATA disk in Drive A, C:\WUGX> displayed.
 Activity steps.
 Key in:


Chapter 5
Internal Commands – COPY and TYPE
COPY *.TMP A:*.NEW
DIR A:*.NEW

Activity completed.
THE TYPE COMMAND
 The TYPE Command
 Internal command.
 Opens and displays file on screen.
 File scrolls – use Pause to stop scrolling.
 File must be ASCII file for data to be
meaningful.
 TYPE syntax: TYPE [drive:] [path] filename
 TYPE – command (the work) you want
system to perform.
 [drive:] – represents (designated)drive letter.
 [path] – name of subdirectory where file is
located.
SECTION 5.7 (p. 193)

Slides 31-32
 Discuss when wildcards used with
DIR and COPY commands.
 If files you wish to copy have same file
extensions can use wildcards to reduce
number of commands that have to be
typed in.

Discussion Question (8) - When would
you use a wildcard with the COPY
command?
SECTION 5.8 (pp. 193-195)
 Slide 33
 If not using default value would need to
key in destination drive and destination
file extension.
 IF NTFS is file system – copy will copy
files in alphabetical order.
SECTION 5.9 (p. 195)

Slides 34-35
 DIR.




- Shows you what files are on disk.
- Does NOT show you contents of files.
NO BRACKETS = Parameter
mandatory.
What is between brackets is optional.
Drive letter is “designated disk drive”.
Beginning with Windows 2000 and
Windows XP can use
multiple files and wild cards
with TYPE.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 5
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Filename.

 If file has an extension, include it as
part of file name.
 Note: do not key in “filename” but
actual filename. True of all parts of
syntax.
To stop scrolling when using TYPE with a
long file add:
Chapter 5
Internal Commands – COPY and TYPE




Discussion Question (9) - What is the
purpose and function of the TYPE
command? Explain each part of the syntax
diagram.
TYPE [drive:] [path] filename | more
 MORE filter explained more fully in later
chapter.
File must be text file to be readable.
 TYPE command will not display contents
of document file created with a word
processing program like WordPerfect or
Word.
ACTIVITY—DISPLAYING FILES USING THE
TYPE COMMAND
 Displaying Files Using the TYPE Command
 DATA disk in Drive A, and C:\WUGXP>
displayed.
 Activity steps.
 Key in:







TYPE
TYPE GAMES\MLINK\MLTORA.EXE
TYPE GAMES\MATCH32\TUNE1.MID
TYPE JUP.TMP
TYPE A:JUP.TMP
CD \

Activity completed.
SECTION 5.10 (pp. 196-199)

Slide 36
 TYPE command
Must be followed by file name
Displays contents of file – even if it
looks like nonsense.
 ASCII = Unformatted text file.
- Readable text file.
- Code that makes files readable.
Files
in a common language that almost all
programs can recognize.
 Support files.
- Extension .DLL.
- Not text files- Not readable.
 Format – how data is arranged.
 Usually only program that generates
data files can read the data.
 Mandatory and optional parameters.
- TYPE requires a parameter.
- DIR does not.


Discussion Question (10) - How can you
recognize an executable file?
Discussion Question (11) - What are
ASCII files?
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 6
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 5
Internal Commands – COPY and TYPE
DUMMY FILES
 Dummy Files
 Files have no particular meaning.
 Common in data processing.
 Used to test different portions of systems or
programs.
 Student will be creating dummy files to learn
the DOS commands that manipulate files.
 COPY command = make copies.
 TYPE command = display file contents.
SECTION 5.11 (p. 199)
ACTIVITY—USING THE COPY AND TYPE
COMMANDS
 Using the COPY and TYPE Commands
 DATA disk in Drive A and C: WUGXP>
displayed.
 If necessary, use Configuration Table in
Chapter 1.6 for appropriate substitutions.
 Activity steps.
 Key in:
SECTION 5.12 (pp. 199-202)










A:
COPY JUP.TMP JUP.OLD
TYPE JUP.TMP JUP.OLD
COPY AST.TMP AST.TMP
COPY AST.TMP ASTROLOGY.TXT
TYPE ASTROLOGY.TXT AST.TMP
COPY JUP.TMP JUPITER.TXT
COPY MER.TMP MERCURY.TXT
COPY VEN.TEMP VENUS.TXT
DIR *.TMP *.TXT

Slide 37
 Give example of how/why dummy files
created.


Discussion Question (12) - What is the
purpose and function of dummy files?
Slide 38
 Data does not matter.
- Don’t worry about typographical errors.
- These are just data files to manipulate.
 Contents of two files can be identical
on same drive/subdirectory if names are
unique.
 DIR shows current files on disk.
 TYPE.
- Shows contents of file.
- Displays one file at a time
- Can use more than one parameter
As far as system is concerned what makes a
file different is its unique file name.

Activity completed.
SECTION 5.13 (p. 203)
MAKING ADDITIONAL FILES ON THE SAME
 Slide 39
DISK
 Give examples of why you would want
 Making Additional Files on the Same Disk
to make a copy of a file on the same
 Can have extra copies of files on same disk,
disk.
but keep in different subdirectory.
 This way, similar files can be grouped together.
Discussion Question (13) - Every file on a
 Can have same name if file is in different
disk must have a unique name. Yet, when
subdirectory - path name makes the file name
you make a copy of a file on the same disk
unique.
in a different subdirectory, it may have the

same file name. Explain.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 7
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
ACTIVITY—USING THE COPY COMMAND
 Using the COPY Command
 DATA disk in Drive A, A: \> is displayed.
 Activity steps.
 Key in:









MD \CLASS
DIR
DIR CLASS
COPY A:\JUP.TMP A:\CLASS\UJUP.PAR
COPY MER.TMP CLASS\MER.PAR
DIR CLASS
TYPE JUP.TMP CLASS\JUP.PAR
TYPE MER.TMP
TYPE CLASS\MER.PAR

Activity completed.
Chapter 5
Internal Commands – COPY and TYPE
SECTION 5.14 (pp. 203-207)

 Review use of:
- MD & <DIR> (including syntax).
- Naming subdirectories.
- First backslash/other backslashes.
- Dot (.) and double dot (..)
- Absolute/relative paths.
With relative path – don’t need to
key in default drive and directory
 Discuss how to copy file into root
directory.
 Discuss why wildcards are not used
with TYPE in this activity.
 TYPE does support use of wildcards.
- In same directory wildcard used with
common element. Multiple directories
must use multiple wildcards.

USING WILDCARDS WITH THE COPY
COMMAND
 Using Wildcards with the COPY Command
 Used to copy files on same drive to different
directory.
 Used to save time and keystrokes.
 Never violate syntax when using OS
commands.
ACTIVITY—USING WILDCARDS WITH THE
COPY COMMAND
 Using Wildcards with the COPY Command
 DATA disk in Drive A with A: > displayed.
 Activity steps.
 Key in:





COPY *.TMP CLASS\*.ABC
DIR *.TMP then DIR CLASS\*.ABC
TYPE MER.TMP
TYPE CLASS\MER.ABC
Activity completed.
Slide 40
Discussion Question (15) - Can you use
wildcards with the TYPE command? Why
or why not?
SECTION 5.15 (p. 207)

Slides 41-43
 Files can sometimes be "misplaced"
User gives instruction - thought meant
one thing - in reality meant something else.
Commands always follow commands.
User must know what they told the
computer to do.
Paths are important.

Discussion Question (14) - Under what
circumstances could a user think that the
computer has "lost its files?
SECTION 5.16 (pp. 207-209)
 Slide 44
 Unless specified, the default
drive/directory assumed.
 Explain why this exercise is quicker
and easier at command line instead of
GUI.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 8
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 5
Internal Commands – COPY and TYPE
USING COPY AND DIR WITH
SUBDIRECTORIES
 Using COPY and DIR with Subdirectories
 COPY command can place files in
subdirectories.
 DIR command sees that files were copied.
SECTION 5.17 (p. 209)
ACTIVITY—USING COPY WITH
SUBDIRECTORIES
 Using COPY with Subdirectories
 DATA disk is in Drive A with A: \> displayed.
 Activity steps.
 Key in:
SECTION 5.18 (pp. 210-216)






















CD ASTRONOMY\MERCURY
DIR
COPY \CLASS\JUP.PAR FINAL.RPT
COPY FINAL.RPT NOTE2.TMP
COPY FINAL.RPT NOTE3.TMP
DIR
MD \WORK
MD \WORK\CLIENTS
MD \WORK\ADS
COPY *.* \WORK\CLIENTS
DIR \WORK\CLIENTS
COPY \WORK\CLIENTS\NOTE?.TMP
WORK\ADS\EXAM?.QZ
DIR \WORK\ADS
C:
CD \WUGXP
COPY DRESS.UP A:
DIR A:DRESS.UP
DIR A:\DRESS.UP
A:
CD C:\
DIR C:ZZZ*.*


Slide 45
Slide 46
 Unless path specified all activities








occur in default subdirectory.
Importance of spacing in commands.
- Discuss spacing in COPY.
First \ is root and the rest are delimiters.
Can always use absolute path
If using relative path be sure you are
aware of current default drive and
directory.
Explain.
- How to change directories.
- Use of DIR to locate files.
Any command will work if proper
syntax and path are used.
Windows always remember last default
subdirectory of the drive you were on.
Discussion Question (16) - What does the
first \ in any command line mean?
Activity completed.
USING SUBDIRECTORY MARKERS WITH
THE COPY COMMAND
 Using Subdirectory Markers with the COPY
Command
 Can use dot (.) and double dot (..) as shorthand
way of writing commands.
 Double dot represents parent of current
directory.
 All directories except root have parent
directories.
 Works with all DOS commands.
SECTION 5.19 (p. 216)

Slides 47-48
 Subdirectory markers sometimes called
dot notations.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 9
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
ACTIVITY—USING SHORTCUTS: THE
SUBDIRECTORY MARKERS
 Using Shortcuts: The Subdirectory Markers
 DATA disk in Drive A with A:
\ASTRONOMY\MERCURY>displayed
 Activity steps.
 Key in:



Chapter 5
Internal Commands – COPY and TYPE
SECTION 5.20 (pp.216-218)

Slide 49
COPY FINAL.RPT ..\FIRST.TST
COPY ..\FIRST.TST ..\VENUS\LAST.TST
DIR ..\VENUS
CD \


Activity completed.
OVERWRITING FILES WITH THE COPY
COMMAND
 Overwriting Files with the COPY Command
 Unique name for each file on same disk in
same subdirectory.
 Can use same name if more than one disk,
or more than one subdirectory.
 Overwrite.
 Write over/replace what used to be in that
file.
 Old data replaced by new data.
 Overwriting also occurs on same disk when
destination file name already exists. Also
applies to subdirectories.
 Process seems dangerous because data lost in
file, but overwrite files on regular basis files
backed up.
 Prior to DOS 6.2, if file name on destination
disk were the same as source file, destination
file would be overwritten with contents of
source file without a warning.
 Now, W warns if there is an overwrite.
SECTION 5.21 (pp.218-219)

Slides 50-53
 Discuss reasons why you would want to
copy your files.
 If contents of source file are different
from contents of destination file and
you overwrite destination file, then
both files now have same file name and
also same file contents.



Discussion Question (17) - What does it
mean to "overwrite a file"? What are some
of the dangers of overwriting files?
Discussion Question (18) - Why would
you make a copy of a file on the same
disk? On another disk?
Discussion Question (19) - What would
happen if you tried to copy a file from one
disk to another and the destination disk
already had a file with the same name?
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 10
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
ACTIVITY—OVERWRITING FILES USING
THE COPY COMMAND
 Overwriting files using the COPY Command
 DATA disk in Drive A and A: \> is displayed.
 Activity steps.
 Key in:











TYPE GALAXY.NEW
TYPE JUP.OLD
COPY GALAXY.NEW JUP.OLD
Y
TYPE GALAXY.NEW
TYPE JUP.OLD
COPY JUP.OLD JUP.OLD
COPY *.TMP CLASS\*.PAR
A
TYPE JUP.TMP CLASS\JUP.PAR
DIR CLASS\*.PAR
Chapter 5
Internal Commands – COPY and TYPE
SECTION 5.22 (pp. 218-222)

Slide 54
 OS will not allow overwriting or
copying file when source file and
destination file are on same disk and in
same subdirectory and have the same
file name.
 Stress that overwriting is the norm but new versions of OS ask for
confirmation prior to overwriting.

Activity completed.
COMBINING TEXT FILES WITH THE COPY
COMMAND
 Combining Text Files with the COPY Command
 Concatenation is combining contents of two or
more text (ASCII) files.
 Nothing happens to original files.
 Create another new file from original files.
 Most concatenation is accidental and user is
unaware it has happened.
 Occurs easily.
 Clue is to read messages DOS places on the
screen.
 Concatenation should not be done with
either program files or data files that
programs generate.
 Programs are binary code and combining
these files makes binary code useless.
 True of data files that program generates.
 When data file created - program that created
data file "formats" data in way that program
knows how to interpret that data.
 Data file can be read only by program that
created it.
 If program can read foreign data file, it has
converted that foreign data into its own
data format.
SECTION 5.23 (pp. 222-223)

Slides 55-58
 Discuss reasons why you might want to
combine files.
 Learn concatenation because accidental
concatenation of files can occur.
--Important to read messages on screen.
 /A – indicates ASCII file
/B indicates a binary file
 In syntax diagram of two or more items
separated by pipe symbol (|) it is an
either/or choice



Discussion Question (20) - How would
you combine the contents of two files?
Why would you?
Discussion Question (21) - What happens
to the original files when you combine two
or more files?
Discussion Question (22) - What are some
of the dangers of concatenating program
files or data files?
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 11
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
ACTIVITY—COMBINING FILES USING COPY
COMMAND
 Combining Files using COPY Command
 DATA disk in Drive A and A:\> is displayed.
 Activity steps.
 Key in: DIR C:\WUGXP\MUSIC/P
 Cancel the command
 Key in:
 TYPE C:\WUGXP\MUSIC\CALIFSURF
.TXT
 TYPE C:\WUGXP\MUSIC\
CALIFSURFHITS .TXT
 *** (SEE RIGHT COLUMN)
COPY
C:\WUGXP\MUSIC\CALIFSURF .TXT
+ C:\WUGXP\MUSIC\
CALIFSURFHITS .TXT
CalifSuirf.MUS
 DIR CALIFSURF.MUS
 TYPE CALIFSURF.MUS
 TYPE
C:\WUGXP\MUSIC\CALIFSURF.TXT
 TYPE
C:\WUGXP\MUSIC\CALIFSURFHITS.
TXT
 DIR C:\WUGXP\*99
 COPY C:\WUGXP\*99 NINE.TXT
 TYPE NINE.TXT
 TYPE NINE.TXT

Chapter 5
Internal Commands – COPY and TYPE
SECTION 5.24 (pp. 223-228)

Slide 59
 Never concatenate program files.
 Never concatenate data files created







with application programs.
Only text files can be combined.
Important to read messages.
*** Note: In this step there are spaces
between COPY and source file
specifications, before and after the +
sign, and before the destination file
name. The entire command must go
on one line. Command will wrap to
next line on screen.
Using NTFS – files copied
alphabetically
Using FAT32 – files copied in order
found on disk.
Not case sensitive.
Can use wildcards to concatenate text
files.
Discussion Question (23) - What message
on the screen informs you that you have
concatenated several files?
Activity completed.
PRINTING FILES
 Printing Files
 Review:
 Have not printed contents of any file.
 May have done:
 Redirected output of DIR command to
printer.
 Printed file names not file contents.
 Redirected output of TYPE command
to printer (TYPE MY.FIL>PRN).
 Works only if not on network.
 Copied file to printer (COPY MY.FIL
PRN).
 No redirection – copying file to a
device.
 Printing to network printer – may
not work.
SECTION 5.25 (pp. 228-229)

Slides 60-65
 Discuss ASCII files. Emphasize that
these printing techniques are only for
ASCII files.
 Data files generated by application
programs can only be printed from
within application program.
- Application program sends special
signals to printer so data prints
correctly.
 Go over each part of syntax.
- PRINT command
- - PRINT [/D:device] [[drive:] [path]
filename[. . .]]
- /D:device – specifies a print device.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 12
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems




Manually eject paper from printer when using
redirection and COPY.
PRINT command.
 Prints contents of files – not their names.
 Automatically ejects pages.
 Works only for ASCII files.
Reasons for printing ASCII files.
 Hard copy of computer configuration.
 Printer problem from within an application
program.
 To verify it is a software problem.
 Return to command line interface
and print an ASCII file.
 If file prints – software problem
within application program - not
connection problem with printer.
Three ways print text file from command line.
 Use PRINT command.
 Use redirection with DIR command
(Ch02).
 Copy contents of file to printer.
PRINTING IN A LAB ENVIRONMNET
 Printing in a lab environment.
 Printing complicated without a local printer.
 If only access to printer is a network printer –
determine if accommodations have been made
for command line printing.
Chapter 5
Internal Commands – COPY and TYPE


Discussion Question (24) – Name two
ways that you may print the contents of an
ASCII file.
Discussion Question (20) – Identify two
advantages to using the PRINT command
to print the contents of ASCII files.
SECTION 5.26 (p. 229)

Slide 66
ACTIVITY - SETTING UP PRINTING IN A LAB SECTION 5.27 (p. 229-231)
ENVRIONMENT
 Slide 67
 Activity- Setting up printing in a lab environment.
 Activity Steps.
 In many circumstances, normal
1. Determine name of network server/printer.
application printing will not resume
2. Return to desktop by closing command line
until you have disabled command line
window.
printing.
3. Right-click desktop then Click New/Shortcut
4. Fill in location box with information shown
below (substituting the name of your server for
BUSDDIV and your printer for HP504-1
5.
6.
7.
NET.EXE USE LPT1: \\BUSDIV\HP504-1 /YES
Click Next
In Shortcut name box key in Print from
Command Line
Click Finish
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 13
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 5
Internal Commands – COPY and TYPE
8. Repeat step 3
9. Repeat step 4, changing location box
information to NET.EXE USE LPT1 /D
10. Repeat step 5
11. Repeat step 6 changing Shortcut name box
information to Stop Printing from Command
Line

12. Click Finish
13. Open Command Line window and make A:\> the
default prompt
Activity Completed.
ACTIVITY—PRINTING FILES
 Printing Files
 Note 1: DATA disk in Drive A. A:> displayed.
 Note 2: Do not do this activity if on network
unless instructed to do so.
 Activity steps.
 Key in:
 TYPE MER.TMP
 PRINT MER.TMP
 PRINT *.TMP
 TYPE JUPITER.TXT
 Turn printer on. Make sure printer is online or



command line printing is enabled
Key in:
 TYPE JUPITER.TXT > LPT1
 COPY JUPITER.TXT LPT1
SECTION 5.28 (pp. 231-233)

Slide 68
 Can students do activity in lab?
If yes, lab policy on printing?
 Print job – something that is sent to
printer to be printed.
 Can use wildcards with PRINT
command.
 Discuss
Status report
Standard output device – screen
Directing output to screen/device.
Use number one (1)- not letter l.
 Cannot use redirection with COPY
command.
If enabled Print from Command Line, disable it
now
Close Command Line Window:

Activity completed.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line, Instructor’s Manual
Franklin, Beedle & Associates ©2003
Page 14
Download