ITEC 1011 A,B
Week 5 Lab Instructions
Oct 12,13 2000



How to do this lab

Introduction to MS-DOS.

  1. In this lab you will learn how to access MS-DOS so as to be able to run programs by typing commands at what is called a command prompt rather than clicking on icons as in the Windows graphic environment. DOS stands for Disk Operating System. It was the standard PC operating system until 5 or so years ago. It did not allow for multitasking (i.e., running more than one program at the same time) and only provided a graphic environment when Windows (typically Windows 3.1) was run in addition.
    The workstations in the Gauss Lab use the Windows 98 operating system. Windows 98 includes an abridged version of MS-DOS which you will learn to access and use below.
    Note that when you access your email, and type
    % pine
    you are typing a command, pine, at the Unix command prompt, %. Unix is another operating system. You will learn more about it later this term.

  2. Starting an MS-DOS prompt

    1. Click on START,
    2. Put the cursor on Program Files, and click on   .
    3. If you can't find the icon in step iii, click Run, and type "command" in the box that pops up.

    4. The MS-DOS command window will then open. The window will look similar but not exactly the same as the one pictured below.

    5. Question 1: What does DOS stand for?

  3. Simple DOS commands (ver, mem, vol, dir)

    1. Click on the MS-DOS window to activate it.
    2. Type the command ver and press return. This will display the current version of the MS-DOS operating system which you are running.
    3. Type the command mem and press return. This will display the amount of memory available to DOS. This is not the total amount of memory in the computer, it is just the memory allocated to DOS.
    4. Type the command vol and press return. This will return the device or "volume" of the current directory.
    5. Type the command cls and press return. The screen will be cleared.

  4. Getting help in MS-DOS.

    1. Previously, to obtain a list of commands in DOS you only needed to type help at the command prompt. This feature is not available in Windows 98.
    2. To get help on a specific command, type (command name) /? at the command prompt and press return. For example, to get help on the cls command type cls /? . Do this now and the result will be similar to what you see below. Make sure that you type cls /? rather than help cls.

    3. Question 2:What does the prompt command do? (you must use help to look this up--describe it using your own words.)

  5. The file structure in DOS (dir, cd).

    1. In MS-DOS the "Current Working Directory" is displayed as part of the command prompt.

    2. Each device on the computer is assigned a letter by MS-DOS. This was discussed in a prior lab and won't be repeated here. To make the current working directory your personal directory, type F: and hit return.
    3. Notice that the command prompt changes to display the new current working directory.
    4. To view the files in the directory, type dir and press return. The list of files in the current directory will appear.

    5. Enter dir /w . The extra /w tells the dir to use "wide list format" (hence the w). It is an example of what is called a switch.
    6. Type dir /? to see what other switches may be used with dir.
    7. Change the current working directory to the main hard disk C: . To do this, enter C:. Observe that the command prompt changes. Also observe that the we are not in the "root" of the (C:) device but are in a subdirectory.

    8. To get to the "root" directory, give the command cd \ and press return. Make sure that you use the backslash \ instead of the regular slash / or it won't work properly.
    9. Give the dir /w command to see what files are in the root directory of the main hard disk.
    10. The cd (change directory) command changes the current working directory. To make the current directory temp give the command cd temp and press return.
    11. Give the dir command to see what files are in that directory.
    12. To go back into the previous directory, give the command cd ..

  6. Creating and deleting directories (mkdir, rmdir).

    1. The command for creating a directory is mkdir.
    2. Go to your home directory F:
    3. To create the directory jj, give the command mkdir jj.
    4. Use dir to verify it is there.
    5. Make the jj directory the current working directory by giving the command cd jj .
    6. Use dir to verify that there are no files in it.
    7. Go back to the previous directory by using cd ..
    8. To delete the directory, use rmdir jj. It might ask (depending on the version of DOS) " Are you sure you want to delete this directory?". Press "Y" and hit return.
    9. Verify that the directory is in fact deleted.

  7. Viewing and editing text files (edit, type, more).

    1. In Windows, the text editor was Notepad. In MS-DOS, the text editor is the edit command. We will create a text file called blah.txt in your current directory.
    2. At the command prompt give the command edit blah.txt

    3. Type some text into the editor so there is something to save.
    4. Notice the words "FILE", "EDIT", "SEARCH" etc. across the screen. These are the command menus. These are activated using keystrokes. To view the "FILE" menu, hit "ALT" and then "F" -- the highlighted letter in the word "FILE".
    5. Now you can see the menu. Hit "S" -- the highlighted letter in the word "SAVE" to save the file.
    6. To shut down the menu's, if you choose not to complete a command, hit "ALT" to return to text edit mode.

    7. Try and see what is in some of the other menus.
    8. Hit "ALT", "F", "X" to exit, and return to DOS.
    9. Use dir to verify that blah.txt is in your directory.
    10. Another useful command is type, which outputs a text file to the screen. Type type blah.txtto view the file you just created.
    11. An analogous command is the more command. This will display the ---- more ---- at the bottom of each screen full of text. This is useful for long files.

  8. Copying, moving, renaming, and deleting files (copy, move, rename, del):

    1. The command for copy in MS-DOS is copy. We will create a copy of the blah.txt called blink.txt Type copy blah.txt blink.txt
    2. Check the directory and verify that the file was copied.
    3. Type more < blink.txt and to verify that this is in fact the same file.
    4. The move command in MS-DOS is like copy except that the original file is destroyed. Type move blink.txt blue.txt.
    5. Use dir to observe that blink.txt is gone, and there is a new file, blue.txt.
    6. The command which deletes a file is del
    7. Remove blue.txt. Type del blue.txt.
    8. Verify that this file is gone.
    9. In MS-DOS, the del command will delete both files and EMPTY directories.

  9. Redirection and pipes.

    1. Some commands generate output to the screen. It is possible to redirect the output of a command into a file. For example, you could redirect the output from the dir command into a file.
    2. Go to the root directory of the hard disk (C:). To do this, type C: , and then give the command cd \
    3. Give the command dir > dir.txt and press return. The right angle bracket (>) tells the computer to send the output of dir to dir.txt instead of the screen.
    4. Use dir to observe that there is a new file called dir.txt.
    5. If you redirect output to a file that already exists, the original is overwritten. To append redirected output to a file that already exists, use two right angle brackets instead of one.
    6. Give the command dir F: >> dir.txt and press return. This will append the file listing for your personal directory to that of the main hard disk.
    7. Pipes are a variation of redirects: they allow you to redirect the output of a command into another command.
    8. An example of why you would want to do this is dir. Since the output is long, we will "pipe" its output into more.
    9. Give the command dir | more.

  10. File Extensions

      Files that end in .EXE or .COM are actually programs.

      Whenever you give a command such as dir, you running a program located on the hard disk somewhere. As we learned earlier in the course, program files in MS-DOS (and hence also in Windows) all end in the suffix .EXE or .COM. This is short form for Executable or Command. In fact, there is a file called somewhere which is run every time you type dir.

      .TXT files are text files. Notepad saves files as this type. Various software manufactures create their own 3-letter "Extensions". For example, Corel uses the extension .WPD for a "WordPerfect Document". When you look at a web page that displays using Adobe Acrobat, you are viewing a file of .PDF "Portable Document Format" type.

    1. Go back into your personal directory F:
    2. Give the command Notepad.exe blah.txt .
    3. A Notepad window will open containing the blah.txt file. You can close it immediately: we don't need it. It is also possible to omit the .EXE suffix and just type Notepad blah.txt.
    4. Question 3: What do .EXE and .COM mean?
    5. A useful and interesting command is ping.exe. This takes an internet URL as an argument and then returns the average time required to reach that site through the internet. Type the command ping . This will return the average time required to access the York webserver from this computer.
    6. Now give the command ping which is the University of Auckland in New Zealand. How much longer does it take for the signals to reach around the world?
    7. Another interesting command is tracert.exe for trace route. This command also takes an internet URL for the argument (like ping) and returns the actual route taken by packets over the internet enroute to the server.
    8. Type tracert . Packets don't have to travel far to the York webserver. Now do the same for the University of Auckland.
    9. Question 4: How many computers do signals to the University of Auckland have to go through before reaching there?
    10. At the command prompt, give the command telnet . A telnet window will open.
    11. This is the same window that would open if you clicked the "E-Mail" icon in the Steacie lab.
    12. Use PINE to compose an e-mail to the TA.

  11. To Submit:

    If you have been following the instructions, you should have answers to 4 questions in your Notepad window.

    1. Paste the contents of this file (DO NOT ATTACH! -- If you don't know what attach means, don't worry about it) into an e-mail to or .
    2. Make the subject line oct15: lastname studentnumber
    3. Send it.

Disclaimer: Students are responsible for the content of their WWW pages.