Home | Networking | Computer HWare/SWare | NOS: Unix/Linux | Favorites | Contact Me | RCC Home

DOS commands

1. What are the four file attributes recognized by MS-DOS? MS-DOS recognizes the following four file attributes: "Archive" files are files that have changed since they were last backed up.

                     r -read only

                     a -archive

                     s -system file

                     h -hidden file

2. How can file attributes be changed? Attributes can be changed with the ATTRIB command. The "+" sign is used to set a particular attribute and the "-" sign is used to remove a particular attribute. The following command could be used to make REPORT.TXT a "read only" file:

The read-only attribute can be removed just as easily as it is enabled:


3. What is the DISKCOPY command and how is it different from the XCOPY command? DISKCOPY copies the entire contents of one floppy disk to another. All existing data on the destination disk is overwritten during the process. The following command copies the contents of one floppy disk to another, asking the user to swap them in and out of the A drive:


XCOPY copies directories, subdirectories and files to a destination disk. The following command copies all of the files and directories on the disk in drive A to the disk in drive B:

XCOPY A: B: /s /e

/s copies directories and subdirectories unless they are empty. If the /s switch is omitted, only the current directory contents are copied. /e copies all subdirectories even if empty.

DISKCOPY copies a disk track by track, creating a complete disk image. This requires that both the source and destination disks have the same format. In contrast, XCOPY can copy between different formats (e.g., the contents of a 3.5" double-sided, double-density floppy can be copied to a 5.25" single sided, double-density floppy). DISKCOPY will copy hidden or system files, XCOPY will not. DISKCOPY resets the archive attribute; XCOPY does not.

4. What is the DIR command? The DIR command displays a list of all of the files and subdirectories located in the directory specified by the user. The list can be directed to the screen, the printer, or to a file.

5. How can the DIR command be used to print the contents of the root directory?

DIR C: > prn - Prints the contents of the root directory on drive C.
DIR /AH shows all the hidden files in the directory
DIR *.TXT shows all files with extension TXT ( * Is called a wildcard)
DIR CH???.EXE shows all files starting with CH with 3 more letters (? Is another wildcard)

6. How can the DIR command be used to display the contents of the Windows subdirectory in wide format?

DIR C:\WINDOWS /w -Displays the contents of the Windows subdirectory on the screen in wide format (up to five filenames per line).

7. What is the function of the CHKDSK command?

CHKDSK checks the status of a disk and produces a report. The /f switch gives the user the option of fixing any logical errors encountered. The /v switch displays the names of the files as they are checked. CHKDSK has the following capabilities and limitations:
CHKDSK cannot check network drives.
CHKDSK only finds logical errors in the file system (those in the FAT and directories). It cannot detect physical errors.*
CHKDSK marks bad sectors.
CHKDSK reports but cannot fix a cross-linked file.*
* CHDSK capabilities are now provided by the ScanDisk utility.

8. What is the command to provide access to a CD-ROM drive?

MSCDEX provides access to CD-ROM drives. The following lines would be included in CONFIG.SYS and AUTOEXEC.BAT in order to gain access to a CD-ROM using the driver CDROMDRV.SYS in the root directory with the signature MSCD000:



The MSCD000 is the driver signature or name. Each CD-ROM driver must have its own unique name. Also note that the MSCDEX command should appear in AUTOEXEC.BAT before the SMARTDRV.EXE command in order to enabling read-caching of the CD-ROM drive.

9. What is the command to change the prompt?

PROMPT $(dollar sign and then one of the following)

$ = $









10. Note that F3 will repeat a previous command and F1 will bring it back one character at a time.


11. How do I create a new text file? Type EDIT and the new text file name and a window opens which lets you type into the new file.


12. How do I look at an existing file? Use the TYPE command followed by the file name and it will open for you to view it. This allows read only, not modification. If you want to modify the file, open it with the EDIT command. THIS IS FOR TEXT FILES ONLY

13. How do I make a directory? Use the MD (make dir) command followed by the new directory name. MD new (same command as MKDIR)


14. How do I move from one directory to another? Use the CD (change dir) command to move up or down in the directory (tree) structure.

CD WINDOWS will move into the WINDOWS subdirectory

CD .. will move you (back) towards the root directory one step (to your parent dir)

CD\ will move you back to the root directory


15. How do I copy a floppy disk? Use the command DISKCOPY A: A:

and follow the instructions from the computer.


16. How do I copy a file? Use the command COPY followed by the source and the destination location. COPY A:\MYFILE.TXT C:\MYDOCUMENTS\MYSTUF


17. How do I copy all the files from one location to another? Use the COPY command with the wildcard. COPY A:\>* C:\MYDOCUMENTS\MYSTUF


18. How do I delete a file? Use the DEL command
DEL A:\ *.* deletes all files on A drive
DEL THISFILE.TXT deletes a file in the drive and directory you are currently in.
DEL *.BAK deletes all .BAK files in the current directory.


19. What is the PATH command? This command sets a search path for the computer to look for executable files (commands you tell it to do). PATH C:\WINDOWS\SYSTEM
Try typing the command PATH and it will tell what the current path is set for.


20. How do I remove a directory? Use the RD command. CAREFULLY!!



Home | Networking | Computer HWare/SWare | NOS: Unix/Linux | Favorites | Contact Me | RCC Home