Lab 2-6 DOS Games

 

 

  1. Open virtual PC.
  2. Create a new disk. Make it really small (like 2 MB). You’re not creating a new virtual PC, just a new FLOPPY disk (not hard disk). Name it test floppy.
  3. Boot into your DOS VM.
  4. Capture test floppy.
  5. It will probably be the b:\ drive. Move to that drive by type b:\ or try a:\ Write down what the drive letter is:

 

 

 

 

  1. Make a bootable disk using either of the two following DOS commands. If the disk is already formatted, but has no files stored on it, use this command: C:\>SYS A: (or the letter of your drive instead of A). To format the disk and also make it bootable, use this command: C:\>FORMAT ____:/S Your disk should now contain a boot record, the two hidden files, and COMMAND.COM. Compare the bytes available on the disk to a disk that is not bootable. Calculate how many bytes must be in the two hidden files.

 

 

 

  1. Test your bootable disk by restarting the virtual machine while you still have test floppy captured. It should boot.

 

 

 

  1. At the DOS prompt, enter this prompt command as follows (where the space between P and $ can be used to customize the DOS command prompt): PROMPT $P   $G

 

 

 

 

 

  1. What prompt did you get? By examining the prompt, guess what $P in the command line accomplishes and what $G accomplishes. Test your theory by changing the PROMPT command, leaving first $P and then $G out of the command line. Have some fun. Change the prompt to read “I Rock>”.

 

 

 

 

  1. Using EDIT, create an AUTOEXEC.BAT file on your bootable disk. Create a PROMPT command to include your first name. Test the command by booting from this disk. (Type edit AUTOEXEC.BAT).

 

 

 

  1. Without the appropriate PATH command in your active AUTOEXEC.BAT file, you cannot execute software stored on drive C from the A prompt. Test this theory by trying to execute some applications software that you know is stored on your hard drive. For example, if you have WordPerfect on your hard drive, try to execute the software at the A prompt by using the following command:

A:\> WP

 

 

 

What error did you get? Why?

 

  1. Using the information below, do the following:

a.    Create a folder in DOS named EAR.

b.    Go into that folder.

c.    Create a text file using DOS named hair.txt

d.    Create another text file using DOS named wax.txt. I know, gross. But hey, it keeps things interesting, right?

e.    Using the attrib command, display the attributes for wax.txt

f.     Change the attributes for wax.txt to hidden.

g.    Change the hair.txt file to read only.

h.    Display those attributes and have me check off ______________

i.      Use the command to clear the screen AFTER I check you off.

j.      Within EAR create a folder named bug.

k.    Within bug create a folder named stomach

l.      Within stomach create a file name food

m.   Go back to EAR so that you can see the folder bug if you type dir.

n.    Type tree and show me your tree. ____________

o.    Now use the command to delete that tree.

p.    Why should you be REALLY careful with DELTREE?

 

 

 

q.    Put a floppy into your floppy drive (or work with someone who has a floppy drive). Using the format command, format that floppy.

r.     Switch to the a drive (just type a:\ and hit enter). Type DIR. What’s on the disk?

 

 

s.     Let’s SYS this disk. Go back to your C:\ drive and using the SYS command, create a system disk on A:\.

t.      Now go BACK to the A:\ drive and type DIR. What’s on the disk?

 

 

 

 

u.    How did it get there?

 

 

 

v.    Is that ALL the files there?

 

 

 

w.   Using attrib, unhide the other hidden files. (You might have to look this up!)

 

Common MS-DOS Commands

Command

Purpose

Switches or example usage

ATTRIB

displays or changes file attributes

 

Syntax: ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S]

 

Attrib +r dog.txt turns the file dog.txt to read only

o  +h hides a file (attrib +h chicken.txt)

o  -h shows a hidden file (attrib –h *.* shows all hidden files)

o  +r makes a file read only

o  +s makes a file a system file (hides it even better than hiding)

o  +a turns on the archive bit (so when a backup is done, the file will be backed up)

o  Can nest them attrib +r +s makes a file a system file that is read only

CHDIR or CD

displays the name of the current directory or changes the current directory

o  Cd.. moves up one directory

o  Cd chess moves you into chess. Note: the chess directory MUST be in the directory you are currently residing in

CHKDSK

checks the status of a disk and displays a status report; it can also fix disk errors. Use only with DOS and Windows 9x.

o  /f checks for errors and fixes them (ex: chkdsk c: /f)

o  >logfile.txt creates a log of all errors found that can be printed out (rather than just showing on the screen) (ex: chkdsk c: >log.txt)

o  /v displays all path and filename information for all files on the disk

CLS

clears the screen

 

COPY

copies one or more files to a destination you specify

C:\ copy fred.txt a:\

C: copy c:\docs\*.* a: copies all docs in that folder to the A drive.

C:\windows\copy system.ini system.bak makes a copy of system.ini and names it system.bak

DEBUG

Runs the debug program and editor to view and manipulate the components of a file system on floppy and hard drives, including the FAT, directories, and boot records. You can also use it to view contents of memory and hexadecimal memory addresses.

o  Enter the command DEBUG at the command prompt.

DEFRAG

Defragments fragmented files on a hard drive.

o  /S:N sorts the files by name on the disk

o  /S:D sorts the files by date and time on the disk

DELTREE

deletes a directory and all the files and subdirectories that are in it. Be very careful with this command!!

o  C:\deltree would delete all of C:\

DIR

displays the files and subdirectories that are in the directory you specify

o  Dir /p—list one screen at a time

o  /w use wide format

o  *.txt use a wildcard character

o  Dir myfile.txt checks to see if that file is present

DISKCOPY

copies the entire contents of one floppy disk to another floppy disk. It writes over the existing contents of the destination disk as it copies the new information on it.

o   

ECHO

displays or hides the text in batch programs when the program is running.

o   

EDIT

starts MS-DOS Editor, a text editor you can use to create and edit ASCII text files.

o  Edit a:\autoexec.bat

DEL or ERASE

deletes the files you specify

o  Del *.txt deletes all txt files

o  Del *.* deletes all files

o  Del tory.* deletes all files that start with Tory

EXIT

quits the MS-DOS command interpreter and returns to the program that started it, if one exists.

o   

FASTHELP

displays a list of all MS-DOS 6 commands and gives a short explanation of each.

o   

FDISK

Used to prepare hard drives for first use. Creates partitions and logical drives on the hard drives. Displays partition information, and also used to restore a master boot record.

o  /mbr restore master boot record

o  /status shows installed partitions

FIND

searches for a specific string of text in a file or files

o   

FORMAT

formats a disk for use with MS-DOS

o  /s Stores system files on disk after formatting (io.sys, msdos.sys, and command.com)

o  /v:volumename allows you to assign a volume name (ex. Format /v:happy)

o  /q recreates the root directory and FATs if you want to qucily format a previously formatted disk that is in good condition

o  /F:size specifies size of floppy. (ex. Format f:360 to format it as a 360k floppy)

o  /u allows an unconditional format which completely erases the drive, not just the FAT

o  /autotest does not prompt the user before and during the format

HELP

starts MS-DOS Help

o   

MKDIR or MD

creates a directory

o  Mkdir c:\chicken

MEM

displays the amount of used and free memory on your computer

o   

MORE

displays one screen of output at a time

o   

MOVE

moves one or more files to the location you specify

o   

MSBACKUP

backs up or restores one or more files from one disk onto another

o   

MSD

Provides technical information about your computer

o   

PRINT

prints a text file while you are using other MS-DOS commands

o   

QBASIC

starts MS-DOS Qbasic

o   

RD or RMDIR

deletes a directory

o   

REN

changes the name of the file or files you specify

o  Ren tory.txt mrsk.txt

RMDIR or RD

deletes a directory

o  The directory can only be deleted if there are no files in the directory

o  If the directory contains another directory, that other one must be removed first

o  Example: c:\chicken\lips

o    C:\chicken rd lips

o    Cd..

o    C:\ rd chicken

SCANDISK

starts a disk analysis and repair tool that checks a drive for errors and corrects any problems that it finds. Use with NT, 2000, and XP

o  /p displays information and fixes errors

o  /n starts and stops it automatically (you could put it into a batch file and have scandisk run on boot or shutdown using this command)

SCANREG

Scans and restores Windows 98 registry

o  /restore restore the registry from a backup

o  /fix scans and fixes common problems

o  /backup backs up registry-good if you’re going to make some registry changes and aren’t sure if they’ll work

TREE

graphically displays the structure of a directory

 

UNDELETE

restores files that were deleted previously by using the DEL command

o  Only recovers if you used the DEL command

UNFORMAT

Might be able to reverse the format command…maybe…if you’re lucky. Used if a used disk was formatted by accident.

 

VER

displays the MS-DOS version number

 

XCOPY

copies directories , their subdirectories, and files except hidden and system files. Not available on a DOS boot disk unless you add it.

o  /c continues copying even if there are errors

o  /s copies all files and subdirectories

o  /y overwrites existing files without asking you

o  /-y turns off overwriting without asking

o  /h copies hidden and system files