Beginning DOS Commands - DOC

Document Sample
Beginning DOS Commands - DOC Powered By Docstoc
					                                                                    Name

            PC Troubleshooting - Beginning                          Score            / 10


      More DOS Commands                                             Update Value
                                                                    Make all corrections and resubmit to earn update
                                                                    points



This lab is best completed using virtual machines. You could probably do the entire lab using a
Windows XP virtual machine. Get copies of a Windows XP virtual machine and a Windows 98
(optional) virtual machine from the server.

In this lab, you will be continuing to explore the workings of some more common DOS commands.
Use /? to identify and briefly describe what the following commands do (on your reference sheet)
and then answer the questions in Part II.

Part I: You will need the following commands for this lab, review their help to see what they do and
the syntax before going on to part two.

MKDIR, RMDIR, DELTREE, PATH, PROMPT, SCANDISK, CHKDSK, DOSKEY, REN,
XCOPY, CLS

Part II: Answer the following questions by using what you learned about the above commands.

DOSKEY provides you with a history of the commands you have typed, allowing you to redo them
by using the arrow keys to find the command you want. Run the DOSKEY program and experiment
with how it works by typing a few commands and then using the up and down arrow keys to see
your previous commands. Describe the effects of the keys below.



AUTOEXEC.BAT is a special batch file that runs each time the computer boots up, after
COMMAND.COM has been loaded into memory. It can be used to start or load programs at boot
time, before the Windows GUI loads

Make sure you are in the root directory of the C: drive and type in “EDIT AUTOEXEC.BAT” to
open the AUTOEXEC.BAT file in the MS-DOS editor. Add a line to your AUTOEXEC.BAT to
load the DOSKEY program (same line you used to run DOSKEY above), save AUTOEXEC.BAT
and exit the editor. Reboot your computer and verify that the DOSKEY program was loaded
automatically. Notes:



Experiment with the PROMPT command to change your "DOS prompt" to one that is your name
followed by a colon.
Show and explain the command you typed below:




More DOS Commands                                                                                        Page 1/6
Add a line to AUTOEXEC.BAT to change the prompt to be a 2 line prompt - the first line should
say MSTC Troubleshooting and the second line should be the same as the default prompt (shows
current drive and path, followed by ">"). Reboot the computer and see if it worked properly. (Hint:
do not separate your prompt on 2 lines, look at the help for prompt that creates a new line)
Show and explain line you added to your AUTOEXEC.BAT:




Restore the prompt in AUTOEXEC.BAT to the default (unless you really like this prompt).

Create some new directories on your hard drive, with the following structure. Ensure your prompt
matches the prompts below. Use the appropriate commands to make the prompts match (you do
NOT have to write the change directory commands below)

C:\>
       command to make a new directory, under the root, named DIR1

C:\>
       command to make a new directory, under the root, named DIR2

C:\>
       command to make a new directory, in DIR2, named DIR3

C:\DIR2>
            command to make a new directory, in DIR2, named DIR4

C:\>
       command to show the files and directories in the root

C:\>
       command to show only the directories in the root

C:\>
       command to show the files and directories in DIR1

C:\>
       command to show the files and directories in DIR2

C:\>
       command to show the files and directories in DIR3

C:\DIR2>
           command to show the files and directories in DIR2

C:\DIR2>
           command to show the files and directories in DIR3



More DOS Commands                                                                            Page 2/6
C:\DIR2\DIR3>
                   command to show the files and directories in DIR2

C:\DIR2\DIR3>
             command to make the root directory the current directory

Now we will add some files to the directories - the content of the files does not matter, so we will
create a file and copy it to other, new names. Make sure you are in the root directory of drive C: and
edit a file named FILE1.TXT. Insert your name and today's date to the file and save it. Use the
COPY command to make 4 copies of the file called: FILE2.TXT, FILE3.TXT, FILE4.TXT and
FILE5.TXT.

C:\>
       command to copy FILE1.TXT to FILE5.TXT (you do not need to provide the other commands)

Wildcard characters can be used to substitute part of a filename when typing a command or using
DIR. The "*" wildcard will substitute for 0 or more of any character, for example CA*.TXT would
find CA.TXT CAT.TXT CATCH.TXT, CAP.TXT, CALENDAR.TXT, etc. The "?" wildcard will
match exactly one character (no more, no less), so CA?.TXT will match CAT.TXT, CAP.TXT and
CAN.TXT but not CA.TXT or CATCH.TXT or any of the others with more or less than 6 letters.

C:/>
       command to list only the TXT files in the root directory

Now practice using the MOVE command to move the files into the other directories.

C:/>
       command to move FILE1.TXT to DIR1

C:/>
       command to move FILE2.TXT to DIR2

C:/>
       command to move FILE3.TXT to DIR3

C:/>
       command to move FILE4.TXT AND FILE5.TXT to DIR4 (one command)

C:\>
        command to move FILE1.TXT back to the root directory

C:\>
        command to move FILE2.TXT back to the root directory

C:\>
        command to move FILE3.TXT back to the root directory



More DOS Commands                                                                              Page 3/6
C:\>
        command to move FILE4.TXT AND FILE5.TXT back to the root directory

C:\DIR1>
            command to move FILE1.TXT to DIR1

C:\DIR2>
        command to move FILE2.TXT to DIR2

C:\DIR2\DIR3>
        command to move FILE3.TXT to DIR3

C:\DIR2\DIR4>
        command to move FILE4.TXT AND FILE5.TXT to DIR4 (one command)

Change the name of file FILE5.TXT to FILE6.TXT. Provide two versions of the command below
based on the prompts provided.

C:\>
       command to change the name of FILE5.TXT to FILE6.TXT

C:\DIR2\DIR4>
         command to change the name of FILE5.TXT to FILE6.TXT


CD to the root. Provide three versions of a command to copy FILE6.TXT to a floppy disk (insert a
disk before entering these commands).

C:\>
       command to copy FILE6.TXT to the root directory of the floppy disk

C:\DIR2\DIR4>
    command to copy FILE6.TXT to the root directory of the floppy disk

A:\>
       command to copy FILE6.TXT to the root directory of the floppy disk

Examine your directory structure in Windows Explorer (if available).
Draw a picture of the directory tree for the directories you created below:




More DOS Commands                                                                          Page 4/6
XCOPY can be used to copy a directory and the files and subdirectories it contains all at once. Use
XCOPY /S to copy DIR2 to DIR7 (in the root).

C:\>
 command to copy DIR2(including all subdirectories and files) to DIR7(without first creating DIR7)
Update the picture of your directory tree above:


Use the PATH command to find out what your current PATH is set to.
Write out your complete, current PATH below:



Use the PATH command to clear all search-path settings (only search in the current directory). To
see the effect of not having PATH set up properly, try to execute an external DOS command
(FORMAT, FDISK, etc.). What error message did you get?




Now reset the PATH so it contains a search-path to C:\DOS.
Write the command you used below:




Add C:\DIR1 to the end of the PATH. Hint: using PATH alone will reset the path and overwrite any
path that already exists. Use %PATH% as part of your set statement to include the PATH that has
already been set. Separate different directories of the PATH with the ; character.
Write the command you used below:




Finally, when you are done, cleanup what you have done. Use the RD command to delete DIR1.

C:\>
       command to delete DIR1

Why did this command fail? Correct the problem so you can delete DIR1 using the RD command
(two commands are required)

C:\>

C:\>



More DOS Commands                                                                            Page 5/6
Use the HELP command to determine a better command to use to delete entire folders. Note: you’ll
have to use a Windows 2000 (or better) computer to enter the HELP command—it is not available in
DOS 6.22 or Windows 98.

Use this command to delete DIR2 and DIR7.

C:\DIR2>
     command to delete DIR7

C:\>
       command to delete DIR2

Close your virtual machine without saving any of the changes.




More DOS Commands                                                                        Page 6/6

				
DOCUMENT INFO