Chapter 7 ATTRIB, SUBST, XCOPY, DOSKEY, and EDIT Using CHAPTER OUTLINE

advertisement
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, and EDIT
LECTURE NOTES
CHAPTER OUTLINE
TEACHING SUGGESTIONS
Chapter Overview
 Slides 2-4



The purpose and function of file attributes will  Chapter Overview duplicated in
be explained.
PowerPoint slides.
Utility commands and programs will be used
 After completion of lecture, suggest to
to manipulate files and subdirectories to make
students that they review Objectives and
tasks at the command line easier to do.
Outcomes found on first page of chapter as a
This chapter will focus on the following
check to see if they have mastered concepts.
commands and programs: ATTRIB,
XCOPY, DOSKEY, and EDIT.
FILE ATTRIBUTES AND THE ATTRIB
COMMAND
 File Attributes and the ATTRIB Command
 Root directory.
 Keeps information about each file on
disk.
 File name, extension, size,
date/time file last modified, and
pointer to file's starting cluster in
FAT.
 Each file in directory has attributes.
 Sometimes called flags.
 “Bit” of info either on or off.
 Describes status of a file.
 Can store only 1 or 0.
 Means yes or no, or on or
off.
 Attributes represented by a single
letter.
 S = System attribute.
 System file.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
SECTION 7.1 (pp. 310-311)
 Slides 5-14
 ATTRIB command used to manipulated file.
Can view, set and reset one attribute of one
or many files.
 Explain each attribute.
 Explain syntax diagram:
- Bar acts as a toggle switch - either/or.
Thus, can either set +R or -R but not both at
same time.
- /S can be used alone.
- /D must be used with /S – cannot be used
alone.
 Can change file attributes from Explorer.
- Easier to do these tasks from command
prompt.

Discussion Question (1) - What is the purpose
and function of the ATTRIB command?
Page 1
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems


H = Hidden attribute.
 Hidden files not displayed
with DIR command.
 Files can't be deleted,
copied, or renamed.
 R = Read-only.
 Can only read file.
 Can’t modify or delete file.
 A = Archived file.
 Back-up history of file.
 Archive bit turned on - file
not backed up.
 The NTFS file system has other
attributes.
 Attribute indicating a
compressed/encrypted file and
whether file contexts should be
indexed for fast file searching.
 At command line only
attributes can change with
ATTRIB command are S, H, R,
and A.
ATTRIB command allows manipulation
of file attributes.
 Syntax diagram. See PowerPoint slide #9.
 + = sets attribute.
 - = removes attribute.
 R = Read-only.
 A = Archive.
 S = System file.
 H = Hidden file.
 /S = Processes matching files in
current folder and all subfolders.
 /D = Processes folders as well.
 Most useful are R and H attributes.
 The A (Archive bit) gives backup
history of a file. It is a signal that the
file has not been backed up.
 COPY command does not turn off
the A attribute.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit




Discussion Question (2) - Give two parameters
for the ATTRIB command and describe the
function and purpose of each.
Discussion Question (3) - What are file
attributes?
Discussion Question (4) - What effect does a
file marked "hidden" have for a user? How can
you "unhide" the file?
Discussion Question (5) - What does a file
marked "read-only" mean to a user?
Page 2
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit

XCOPY can read archive bit.
 Determines if file has changed
since last time it was backed
up.
 Decides if file needs to be
backed up.
 Usually do not manually manipulate S
attributes with ATTRIB command.
ACTIVITY—USING ATTRIB TO MAKE
FILES READ-ONLY
 Using ATTRIB to Make Files Read-Only
 Command Prompt window open.
 DATA disk in Drive A, and A:\> is
displayed.
 Specified files can be copied from
/SUGXP subdirectory if necessary.

Activity steps.
 Key in:





















ATTRIB *.99 then ATTRIB C:\*.*
COPY C:\WUGXP\*.FIL
ATTRIB *.FIL
ATTRIB +R STEVEN.FIL
ATTRIB STEVEN.FIL
DEL STEVEN.FIL
COPY C:\WUGXP\*.XLS
DIR *.XLS then ATTRIB +R *. XLS
ATTRIB *.XLS
SECTION 7.2 (pp. 311-317)
 Slide 15
 Note: Steps 8-24 can only be done if




Microsoft Excel installed on computer If
Excel not available - read through
exercise.
ATTRIB is external command.
Using + or - alters attribute.
Read-only means cannot delete or overwrite
file.
Can delete read-only files with /F parameter
with DEL command.
Minimize command line window
Click Start/My Computer
Double-click A drive icon
Click Tools (on menu bar)/ Folder/Options/
View Tab
Remove check from Hide extensions for
known file types.
Click OK
Double-click NEW-SUV.XLS file
Click in Cell A-30 (box right below Toyota)
Key in Latest Thing
Click File (on menu bar)/ Save/ OK/Cancel/
File/Exit/No
Close My Computer window
Click minimized Command line button on
taskbar
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 3
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems


Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
Key in






CLS
COPY STEVEN.FIL BETTE.FIL
ATTRIB + R BETTE.FIL
DEL BETE.FIL
DEL /F BETTE.FIL
DIR BETTE.FIL
Activity completed.
USING THE HIDDEN AND ARCHIVE
ATTRIBUTES WITH ATTRIB
 Using the Hidden and Archive Attributes with
ATTRIB
 Hidden attribute.
 Hides file.
 Files not displayed with DIR
command.
 Useful - allows for manipulation of
files.
 Files protected when COPY or MOVE
commands used with wildcards.
 Can’t see or manipulate files.
 More difficult to perform file operations
on groups of files in Explorer.
 Can hide files.
 Archive bit.
 Flags a file as changed since last time
file backed up.
 Allows copying of files that have been
changed.
 Automatically set (on) when file
written to or changed.
 ATTRIB command can set and unset
this flag.
SECTION 7.3 (pp. 317-318)
 Slides 16-19
ACTIVITY—USING THE H AND THE A
ATTRIBUTES
 Using the H and the A Attributes
 Data disk in Drive A and A:\> displayed.
 Activity steps.
 Key in:
SECTION 7.4 (pp. 318-323)
 Slides 20-21





COPY C:\WUGXP\FI*.*
DIR F*.*
ATTRIB FI*.* +H
DIR F*.*
MOVE F*.* TRIP
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
 Discuss how files are hidden in Explorer.

Discussion Question (6) - What is the function
of the archive bit?
 Discuss.
- Why the ability to hide files is useful to the
user.
How D, R, H, A attributes help to
manage files
When MOVE command used none of
hidden files (/H) will be moved.
Page 4
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit











XCOPY with A attribute – turns off A
flag to indicate file has been backed up
Can manipulate archive bit directly with
ATTRIB command to display if file changed.
- Using ATTRIB and XCOPY command with
various attributes.
- REN file keeps attributes, as it is the same
file.
- COPY file does not carry attributes to copy
since copied file is considered to be new file.
- Use of + and – for setting and unsetting file
attributes.
- Eliminate or add several file attributes with
one command.
DIR /AH
ATTRIB -H FI*.*
DIR F*.*
TYPE STEVEN.FIL
ATTRIB STEVEN.FIL
ATTRIB -A -R STEVEN.FIL
ATTRIB STEVEN.FIL
COPY TRIP\FRANK.FIL
STEVEN.FIL
Press Y
Key in:
 TYPE STEVEN.FIL
 ATTRIB STEVEN.FIL
 ATTRIB +R -A STEVEN.FIL
 ATTRIB STEVEN.FIL
 REN STEVEN.FIL BRIAN.FIL
 ATTRIB BRIAN.FIL
 COPY BRIAN.FIL STEVEN.FIL
 ATTRIB STEVEN.FIL
 ATTRIB BRIAN.FIL
Activity completed.
THE SUBST COMMAND
 The SUBST Command
 External command.
 Can substitute drive letter for a path name.
 Alleviates keying in long path name.
 Can install programs that do not recognize
subdirectory but do recognize disk drive.
 Can derive information from a drive that a
program does not recognize.
 Discuss why students should be cautious
when using SUBST on a network drive.
 On stand-alone system while substitution
in effect:
 Do not use SUBST with LABEL,
CHKDSK, FORMAT, DISKCOPY,
DISKCOM, and RECOVER FDISK.
 Above commands expect drive letter
to represent actual disk drive.
 SUBST syntax:
 To set up new drive: SUBST
[drive1: [drive2:]path
 To undo: SUBST drive SUBST
drive1: /D
 To see SUBST drives: SUBST.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
SECTION 7.5 (pp. 323-324)
 Slides 22-27
 Discuss using SUBST with a network drive.
Networks us letter drive specifications.


Discussion Question (7) - What is the purpose
of the SUBST command?
Discussion Question (8) - Under what
circumstances would the SUBST command be
useful?
Page 5
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
ACTIVITY—USING SUBST
 Using SUBST
 DATA disk in Drive A and A:\ displayed.
 Can activity be done in your lab?
Use a drive letter that is not being used
such as H: or K.
 Activity steps.
 Key in:
SECTION 7.6 (pp. 324-327)
 Slide 28






TYPE ASTRONOMY\MERCURY\
DRESS.UP
SUBST E:
A:\ASTRONOMY\MERCURY
TYPE E:DRESS.UP
SUBST
SUBST E: /D
SUBST

Activity completed.
THE XCOPY COMMAND
 The XCOPY Command
 Review COPY command.
 Internal command.
 Drawbacks.
 Copies one file at a time even if
wildcards are used.
 Cannot copy subdirectory
structure.
 Slow command.
 COPY filename – does not
retain source file attributes.
 Useful for backing up files from hard
disk directories to floppy disks.
 Cannot use DISKCOPY if you have
disks with different formats.
 XCOPY command.
 Powerful and useful.
 External command.
 Copy files that exist in different
subdirectories.
 Copies contents of subdirectory
(both files and subdirectories
beneath parent subdirectory).
 Can specify drive as source to copy all
files on the drive.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
 Discuss virtual (logical) drives.
Virtual drive – one that exists
temporarily
- Drive letter represents but cannot be actual
physical drive.
Not an actual real drive - cannot perform
disk actions on it.
Conceptually how networks operate –
network takes path name and substitutes a
drive letter for the path.
 Discuss SUBST.
- Uses logical drive letter.
- Destination – must use drive letter and
path. - When done - undo SUBST.
SECTION 7.7 (pp. 326-328)
 Slides 29-33
 Parameters available when using XCOPY.
(Continued from the end of left-hand side
column for this section.)
/P = Prompt before creating each destination file.
/S = Copies directories and subdirectories except
empty ones.
/E = Copies directories and subdirectories, including
empty ones. Same as /S /E. May be used to modify /T.
/V = Verifies each new file.
/W = Prompts to press key before copying.
/C = Continues copying even if errors occur.
/I = If destination does not exist & copying more than
one file, assumes destination must be a directory.
/Q = File names not displayed when copying.
/F = Displays full source and destination file names
while copying.
/L = Displays files that would be copied.
/H = Copies hidden/system files also.
/R = Overwrites read-only files.
/T = Creates directory structure, but does not copy
files. Does not include empty directories or
subdirectories. /T and /E includes empty directories
and subdirectories.
/U = Copies only files that already exist in destination.
Updates the files that already exist in destination.
Page 6
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems







Allows users to be very specific about
characteristics of files to be backed up.
 Copy files and subdirectories that
have any attributes.
 Can specify that files and
subdirectories copied retain
attributes.
Provides overwrite protection (file
with same name). Will ask before
overwriting destination file with
source file.
XCOPY is faster than COPY.
Reads all source files into memory and
then copies them as one group of files.
By default will not copy system or
hidden files.
Advantages of command line over
Explorer.
 Drag and drop problems.
 Miss destination.
 Easier to key in commands.
 Can perform file operations on
group of files rather than one file at
a time.
XCOPY syntax. See PowerPoint slide
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
/K = Copies attributes. Normal XCOPY will reset
read-only attributes.
/N = Copies using generated short names.
/O = Copies file ownership and ACL information.
/X = Copies file audit settings (implies /o).
/Y = Overwrites existing files without prompting.
/-Y = Prompts you before overwriting existing files.
(This is the default)
/Z = Copies networked files in restartable mode. The
switch /Y may be preset in the COPYCMD
environment variable.
This may be overridden with /-Y on the command
line.



Discussion Question (9) - What is the purpose
of the XCOPY command?
Discussion Question (10) - What advantages
does the XCOPY command have over the COPY
command.
Discussion Question (11) - List four XCOPY
parameters, and explain their function and their
syntax.
#32.


Source - Specifies file(s) to copy.
Destination - Specifies the location
and/or name of new files.
/A = Copies files with the archive
attribute set, doesn't change the
attribute.
/M = Copies files with the archive
attribute set, turns off the archive
attribute.
/D:date = Copies files changed on or
after the specified date. No date
given, copies only files whose source
time newer than the destination time.
/EXCLUDE: file1 [+file2] [+file3]…
= Specifies list of files containing
strings. If string matches any part of
absolute path of file to be copied, file
will be excluded from being copied.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 7
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems

/P = Prompts before creating each
destination file.
/S = Copies directories and
subdirectories except for empty ones.

Syntax continued on the top of
right-hand side column for this
section.
ACTIVITY— THE XCOPY COMMAND
 Using the XCOPY Command
 DATA disk in Drive A and at A:\
 Activity steps. (Key in:)





















DIR C:\WUGXP\MEDIA
DIR C:\WUGXP\MEDIA\BOOKS
XCOPY C:\WUGXP\MEDIA MEDIA
/S then D then DIR MEDIA
DIR MEDIA\BOOKS
DIR C:\WUGXP\*.TXT
XCOPY C:\WUGXP\*.TXT /D:06-0100 then A then ATTRIB *.BUD
XCOPY /M *.BUD CLASS
ATTRIB *.BUD
COPY FILE2.FP AST.BUD
Y then ATTRIB *.BUD
XCOPY *.BUD CLASS /M
Y THEN ATTRIB *.BUD
COPY C:\WUGXP\*.TXT
A then DIR *.TXT
ATTRIB +H SAN*.TXT
DIR *.TXT then MD HIDDEN
COPY *.TXT HIDDEN
XCOPY *.TXT HIDDEN /H
A then CD HIDDEN
DEL *.* then Y then DIR
DIR /AH
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
SECTION 7.8 (pp. 328-337)
 Slide 34
 Recreate structure on DATA disk using
COPY vs. XCOPY.
 Discuss uses of XCOPY with:
- /S - placed anywhere in XCOPY command.
- /D - copying files modified or created after
a certain date.
- /M - read attribute bit as each file copied
and then turned off archive bit on source file.
 XCOPY.
- Default confirms overwrites.
- Useful for rearranging hard disk.
- Can manipulate the A attribute.
- Can copy hidden files.
 Discuss how XCOPY uses archive bit.

Activity completed.
MULTIPLE XCOPY PARAMETERS
 Multiple XCOPY Parameters
 Ability to perform file operations on
hidden, system, and read-only files.
 Manipulate files having one or more
attributes set.
 Accomplish tasks at command line that
cannot be accomplished in the graphical
user interface.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
SECTION 7.9 (p. 337)
 Slides 35-36
Page 8
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
ACTIVITY—USING MULTIPLE XCOPY
PARAMETERS
 Using Multiple XCOPY Parameters
 DATA disk in Drive A & A:\HIDDEN>
displayed.
 Activity steps.
 Key in:
SECTION 7.10 (pp. 337-342)
 Slide 37



















MD HOLD
XCOPY *.TXT HOLD /H
DIR HOLD
DIR HOLD /AH
XCOPY \FILE*.* /L
COPY \FILE*.*
ATTRIB *.FP +R
ATTRIB +S *.CZG
ATTRIB *.SWT +S +H +R
DIR
ATTRIB
CD \
MD HIDDEN2
XCOPY HIDDEN HIDDEN2 /S /H
/R /E /K
CD HIDDEN2
ATTRIB /S
CD \
RD HIDDEN /S
Y
RD HIDDEN2 /S
Y
Close Command Prompt window.




Activity completed.
DOSKEY
 DOSKEY
 External memory-resident command.
 Automatically loaded into memory
when open the Command Prompt
 Remains in memory during current
DOS session.
 Keeps track of last 50 commands
entered when in Command Prompt
window
 Stores above in memory called
command history.
 Can recall and edit commands.
(Table 2.1 in Chapter 2)
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
 - XCOPY with /L.



Find out which files would be copied
Does not copy files.
“Previews” files that would be copied.
With ATTRIB command order of parameters
does not matter.
XCOPY parameters
/S – Copies directories and subdirectories
except empty ones.
/H – Copies hidden and system files
/R – Overwrites read-only files
/I – If destination does not exist and are
copying more than one files,
assumes destination must be directory.
. If you do not include this parameter will
be asked if copying to directory or a file.
/E – Copies directories and
subdirectories, including empty ones.
/K – Copies attributes. XCOPY will
automatically reset read-onlyattributes.
/SHRIEK – 6 parameters used together –
copies everything, retaining all attributes
 /SHREK – If destination does exist and you
do not need /I parameter.
SECTION 7.11 (pp. 342-343)
 Slides 38-44
 DOSKEY lets you recall command lines, edit
them, keep a command history, and write
macros.
 Compare internal and external commands.
 Text - specifies command you want to record.
 DOSKEY syntax.
/REINSTALL = Installs new copy of Doskey.
/LISTSIZE = Size – sets size of command history
buffer.
/MACROS = Displays all DOSKEY macros.
/MACROS: ALL = Displays all DOSKEY macros
for all executables, which have Doskey macros.
MACROS:exename = Displays all DOSKEY
macros for the given executable.
Page 9
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit



Once screen is closed and you return to
desktop, DOSKEY no longer in
memory.
Works as a TSR (Terminate Stay Resident).
 Read from disk and loaded into
memory only when first run.
 No need to reload it from disk each
time used.
 After initial load - Run from
memory like internal command.
 Does not release memory for
duration of MS-DOS work session.
 Can load other programs - other
programs will not use memory
TSR has claimed.
DOSKEY.
 Recalls command lines and edits them.
 Keeps command history.
 Writes a macro.
 Command defined to automate set
of commands that are often used.
 Kept in file – retrieved/executed
/HISTORY = Displays all commands stored in
memory.
/INSERT = Specifies new text typed is inserted in
old text.
/OVERSTRIKE = Specifies new text overwrites
old text.
/EXENAME=exename = Specifies the executable.
MACROFILE=filename = Specifies a file of
macros to install.
Macroname = Specifies a name for a macro you
create.


Discussion Question (12) -Explain the purpose
and function of the DOSKEY command.
Discussion Question (13) - What is a memoryresident program and how does it work?
with one command



Simplifies retyping of commands.
& symbol - separates commands
on a command line.
 Separate commands with $T when
creating a macro.
Syntax: DOSKEY See PowerPoint slide #39


Editing keys. See PowerPoint slides #42-44.


Definitions in column on right-hand
side.
<Alt> + <F10> clears macro definition
(not on chart).
Special codes in DOSKEY macro
definitions. See PowerPoint slide #45.



$T - Command separator. Allows
multiple commands on same line.
$1-$9 - Batch parameters. Equivalent
to %1-%9 in batch files
$* - Replaced by everything
following macro name on command
line.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 10
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
ACTIVITY—USING DOSKEY
 Using DOSKEY
 Activity steps.
SECTION 7.12 (pp. 343-346)
 Slide 45


Close current Command Prompt window.
Open new Command Prompt window.

Key in:












A:
DIR *.TXT
DIR C:\WUGXP\*.99
VOL
DOSKEY /HISTORY
DOSKEY /HISTORY > TEST.BAT
TYPE TEST.BAT
CD CLASS & DIR *.BUD & CD \
DOSKEY bb=CD CLASS$TDIR
*.BUD$TCD \
bb
DOSKEY /MACROS > b.bat
TYPE b.bat

Activity completed.







THE COMMAND PROMPT TEXT EDITOR
 The Command Prompt Text Editor
 Used for writing needs.
 Allows full flexibility in creating/editing
documents.
 Inserting graphics.
 Changing fonts.
 To retain selections.
 Special codes entered into programs as
document is formatted.
 Can save documents as ASCII text
(text/unformatted text- MS-DOS texts).
 Strips formatting and saves only
keyed-in text.
 Text or ASCII files.
 Used to give OS instructions.
 Text editors.
 Creates text documents.
 Writes batch files.
 Not a word processor.
 Cannot format data in document.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
/HISTORY parameterRecall what commands keyed in.
Like F7 key but DOSKEY writes output to
screen - means can redirect output to file.
---Will learn to write batch files later – can
execute series of command with one command.
Batch files - executable files.
Macro – run a series of often-used commands.
Can have more than one command on line in
Command Prompt window
Separate commands with ampersand ($) and
separate commands in a macro with $T
Close Command Prompt window - macros
created in this window no longer exist
To reuse - redirect macros into a batch file.
Discussion Question (14) - Explain what a
macro is and how you would create one.
Discussion Question (15) – Discuss how to
execute commands from the history list.
SECTION 7.13 (pp. 346-348)
 Slides 46-56

Discussion Question (17) – Compare and
contrast a word-processing program, Notepad,
and MS-DOS EDIT.
Page 11
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems

Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
 Every OS has one.
 NOTEPAD used on desktop.
 EDIT used at command prompt
window.
EDIT.
 Cannot manipulate environment.
 Edit File menu.
 Open new document.
 Open existing document.
 Save a document.
 Save a document under new name.
 Print a document.
 Exit the editor.
 Edit menu.
 Cut, copy, or delete selected text.
 Paste previously cut or copied text.
 Search menu.
 Find specified string of text.
 Repeat last find and search.
 Replace a specified string of text
with another string of text.
 View menu.
 Split, size, or close Edit window.
 Options menu.
 Change printer port or tab settings
and choose color scheme for edit
window.
 Help menu.
 Get list of Edit commands.
ACTIVITY—USING THE COMMAND
PROMPT TEXT EDITOR (EDIT)
 Using the DOS Text Editor



DATA disk in drive A, A: \> displayed.
In this section will be editing, creating, and
overwriting files with text editor. File size,
bytes, and bytes free numbers shown in
directory listing will vary – will most likely
not match examples shown in text.
To make mouse work in window – need to
alter some properties of the window.
SECTION 7.14 (pp. 348-357)
 Slides 557-58
 Explain how to make mouse work in a
window.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 12
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems

Activity steps.





































Alter window properties to make mouse work
in window. (Window or in full-screen mode)
Key in: EDIT
Make screen blank then go to full-screen
mode.
Key in:
This is a test. <Enter>
This is more test data.
Press <Ctrl> + <Home>
Key in: THIS IS MORE DATA
Press <Insert>.
Key in: My second
Press <Insert>.
Click under first t in the phrase test data.
Hold down left mouse button and drag to end
of the sentence.
Press <Delete> key.
Key in: meaningless data
Click <File> then <Open>.
Key in: A:\PERSONAL.FIL
Click OK then <Search> then <Find>
In Find What area, key in: Jones
Click OK. Press <F3> key three times.
Press <down> key four times.
Align the following two lines.
FIRST LINE: Peat Brian 125 Second
Vacaville CA Athlete
SECOND LINE: Farneth Nichole 237
Arbor Vacaville CA Dancer
Click File then Exit then No then Yes
Open Command Prompt editor
Click File then Open.
Key in: A:\STEVEN.FIL
Click View then Split Window.
Change word Frank in top screen to Steven.
Click File then Save then File then Close.
Place cursor in top window
Click File then Open.
Key in: A:\TEST.BAT. Click OK
Place cursor in bottom window.
Click File then Open.
Key in: A:\B.BAT. Click OK.
In top window delete first line (A:) and the last
two lines (DOSKEY /HISTORY and
DISKEY /HISTORY >TEXT.BAT)
In bottom window, alter line to read:
DOSKEY bb=CD CLASS $TDIR
*.BUD$TCD
Save and then close both files.
Exit the editor.
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
 Two modes of operation
Insert mode – default
Cursor is small blinking line
Any data following cursor not replaced Line pushed along.
Overstrike –
New data in front of old data.
Replaces characters that are there.
Cursor is a vertical rectangle.
 Can toggle between overwrite mode and
insert mode by pressing <Insert> key
 Full screen-editing using
Mouse
Keystrokes
Pressing <Alt> key and first letter of
menu drops down menu
Select highlighted letter of task to perform
 View two files simultaneously on split
screen.
 Execute batch file by keying in its name.
Page 13
Instructor: Prof. Michael P. Harris
ITSC 1405 – Intro to PC Operating Systems






Chapter 7
Using ATTRIB, SUBST, XCOPY, DOSKEY, & Edit
Close Command Prompt window
Open a Command Prompt window
Make A:\ the default drive.
Key in: bb then B
Close Command Prompt Window
Activity completed.
USING TEXT DATA FILES
 Using Text Data Files
 Why use text editor to create data.
 Desired program not available.
 Can import text files from many
programs.
 Interpreted into needed format.
 With computer can record needed data
in a text file.
 Text files take up little space
--Save to floppy – transportable.
matter where .
ACTIVITY—IMPORTING A TEXT FILE
 Activity – Importing a text file.
 At desktop – no open command line
windows.
 Assumes class files installed at
C:\WUGXP. If not substitute appropriate
directory for environment.
 Activity steps


Open Microsoft Excel Program
Click Data on menu bar
Point to Import External Data or Get
External Data
Click Import data or Import Text file on

menu
Click arrow by Look in: drop down box








and navigate to C:\WUGXP
Double click PLANETS.TXT
Click Next
Clear Tab check box
Select Comma check box
Click Next then Finish then OK
then Exit then No
SECTION 7.15 (p. 357)
 Slide 59
 Next activity use Excel spreadsheet program
and import text data into usable spreadsheet.
Used Microsoft Excel 2002 from Microsoft
Office XP suite
Other versions of Excel and other
spreadsheet programs work in similar fashion
with minor adjustments.

Discussion Question (16) – How could you use
the Editor program to create useful data
information?
SECTION 7.16 (pp. 357-360)
 Slide 60
 Text Import Wizard screen used to further
refine data
Preview window in bottom portion of
dialog box
then File
Activity completed
Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line
Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1
Page 14
Download