Sunday 29 September 2013

DOS Tutorial Lesson 3

A. Create a DOS File.
B. Copy a File.
C. Copy a File with a New Extension.
D. Type a File with DOS.
E. Rename a File
F. Rename a Group of Files


Create a File with DOS

Directions:

1. Type: copy con Quick.ltr and press return.
2. Type this message in the following format:
Bob
Sales are up 15%.
Good Job!
Craig
3. Press the F6 function key (^Z) and press return.
4. DOS gives you a message that 1 File(s) has been copied.
5. Type: dir q* and press return.
6. Now you can see the list of files beginning with the letter Q.

NOTE: You can also use the COPY command to print a file by typing: copy quick.ltr prn and press return.



Copy a File

You can use the COPY command to copy one file to another.

Directions:

1. Type: copy quick.ltr quick2.ltr and press return.
2. DOS will tell you one file has been copied.
3. Type: dir q* and press return.
4. You should have two files listed with different names.

NOTE: Filenames cannot be more than eight characters in length. File extensions cannot be more than three characters in length.


Copy a File with a New Extension

You can also use the COPY command to copy the file with a different filename extension.

Directions:

1. Type: copy quick.ltr quick.bac and press return.
2. Type: dir q* and press return.
3. Three files should be listed.


Type a File with DOS

If you need to check the contents of a particular file or any DOS file, you will need to use the TYPE command.

Directions:

1. Type: type quick2.ltr and press return.
2. DOS prints the contents of the file.

NOTE: Never use the TYPE command with files that have the .com, .exe, .sys, and .bas extensions. These are program files and will only display junk on the screen.


Rename a File

The RENAME command lets you rename a previous file with a new name.

Directions:

1. Type: ren quick2.ltr sales.ltr and press return.
2. Type: dir *.ltr and press return.
3. DOS lists only two files that have the .ltr extension: quick.ltr and sales.ltr.


Rename a Group of Files

With the wildcard character *, you can also use the RENAME command to change a group of files.

Directions:

1. Type: ren *.ltr *.bob and press return.
2. Type: dir *.bob and press return.
3. You should have two files listed with a .bob extension.
4. Type: dir *.ltr and press return.
5. There should be no files found with .ltr extensions.


NOTE: You can also rename a group of files that have the same name but different extensions. Type the RENAME command then the filename followed by the dot and the wildcard, space and then type the new filename followed by a dot and the wildcard character. It will look like this: filename.* newfilename.*

No comments:

Post a Comment