Common DOS Commands
Helpfixmypc.com Home
 

 


(For Informational Purposes - always hire a professional)

Common Dos Command (others below)

Append Assign Attrib Backup break
buffers call chcp chkdsk choice
cls command comp
date
xcopy  

 

Backup Files

It is possible to lose files by mistake, it is good practice to make backup copies of your most valuable files. Use the COPY command to create the backup.

 

Change the Default Drive

To change the default drive, simply type the letter of the your choice.

Ex:

  • C> A: [enter]
  • Changes the default drive from C to A.
  • A> C: [enter]
  • Changes the default drive from A to C.

CHDIR (CD) Change Directory

Once you have located the directory you want, you may move from directory to directory using the CD command (change directory)

Example:

  • C> cd dir1
  • Moves you to the directory called 'dir1'
  • C> cd \dir1\sub1
  • Moves you to the directory called 'sub1' under the directory called 'dir1'.
  • C> cd ..
  • Moves you up one level in the path.
  • C> cd \
  • Takes you back to the root directory c:

COPY Command

The COPY command can be used both to copy files from disk to disk or to create a second copy of a file on a single disk.

Example:

  • C> copy c:file1.exe a:
  • Copies the file 'file1.EXE' from the C drive to the A drive and gives it the same name.
The key to use this command correctly is to remember that the first file specified after the COPY command is the source file, the second is the target:ehp1 file. The source is the file to be copied. The target will be the location and name of the new file. If the file name and extension are omitted after the target's drive specification, the new file will have exactly the same name as the source file.

DIR (Directory) Command

The DIRECTORY command lists the names and sizes of all files located on a particular disk.

Example:

  • C> dir a:
  • Shows directory of drive A
  • C> dir b:
  • Shows directory of drive B
  • C> dir \abc
  • Shows files in a subdirectory on drive C (default)
  • C> dir
  • Shows directory of drive C
  • C> dir /w
  • Shows directory in wide format, as opposed to a vertical listing.

DIR Options

Two little characters, '*' and '?', will make your life with computers much easier. Their use is illustrated below.

Example:

  • C> dir a:*.ex
  • Lists all files on the A drive with an extension of 'EXE'.
  • C> dir b:file1.*
  • Lists all files on the B drive with a filename of file1'.

ERASE Command

The ERASE command deletes specified files.

Example:

  • C> erase a:myfile.txt
  • Erases the file MYFILE.TXT from the diskette in the A drive. If no drive specification is

FORMAT Command

You must format new disks before using them on the IBM computers. The format command checks a diskette for flaws and creates a directory where all the names of the diskette's files will be stored.

Example:

  • C> format a:
  • Formats the diskette in the A drive.
  • C> format b:
After entering this command, follow the instructions on the screen. When the FORMAT operation is complete, the system will ask if you wish to FORMAT more diskettes. If you are working with only one diskette, answer N (No) and carry on with you work. If you wish to FORMAT several diskettes, answer Y (Yes) until you have finished formatting all your diskettes.

MKDIR (MD) Make Directory Command

This command creates a new directory.

Example:

  • C> mkdir mine
  • Creates a directory called 'MINE'

RENAME (REN) Command

The RENAME command permits users to change the name of a file without making a copy of it.

Example:

  • C> ren a:goofy.txt pluto.txt
  • Changes the name of 'GOOFY.TXT' on the A drive to 'PLUTO.TXT'.
This command is very simple to use, just remember two points: the file name and extension must be complete for the source file and no drive specification is given for the target. Renaming can only occur on a single disk drive (otherwise COPY must be used).

RMDIR (RD) Remove Directory Command

This command removes a directory. It is only possible to execute this command if the directory you wish to remove is empty.

Example:

  • C> rd mine
  • Removes directory called 'MINE'.