DOS  Command Guide                       

  1. How do I set DOSKEY?
  2. How do I set the TIME and DATE?
  3. Where can I find the version of the operating system ?
  4. How do you format a disk?
  5. What is the command for checking what is in your directory?
  6. How do you clear the screen?
  7. What is the command for copying a disk?
  8. Close the Command Prompt Window and the session.
  9. Save your DOS Key History.
  10. What do you do to check your DOSKEY history?
  11. How do you display Attributes in your directory?
  12. What do you use a wildcard* for?
  13. Setting the Windows Environment.
  14. How do you change root directories from C to A or A to C?
  15. View the contents of a ASCII text file.
  16. How do you use a pipe operator?
  17. What does the MORE filter do?
  18. How do you sort the contents of an ASCII text file?
  19. Can you search for a text string in an ASCII text file?
  20. What is the command for appending output to an ASCII text file?
  21. How do you redirect output to the printer?
  22. How do you create a copy of a file?
  23. What is the general syntax for renaming files?
  24. Can you rename multiple files?
  25. What commands can I use to delete files?
  26. How do you MOVE files?
  27. How do you make a new directory?
  28. How do you copy files to another directory?
  29. What is the difference between a relative and a full (absolute) path?
  30. How can you change the current working directory?
  31. How can you change to the root directory?
  32. How can you copy files to another directory?
  33. What command do you type to view a Directory Structure in Win2000?
  34. The command to display a directory tree of a Hard Disk.
  35. The command to display a directory tree of your Data Disk.
  36. What command do you use to remove Directories?
  37. How do you MOVE a directory?
  38. How do you MOVE selected files?
  39. What command do you use to Rename a directory?
  40. How can I locate files in Directories?
  41. How do you examine file attributes?
  42. What is the command for backing up a directory folder?
  43. How do you check the boot order in CMOS?
  44. To format and copy the System files to a disk you use what command?
  45. How would you make a Windows setup disk?
  46. What are some of the contents of the setup disk?
  47. How do you create an Emergency Repair Disk?
  48. How do you use the Emergency Repair Disk?
  49. How do you use the Check Disk Utility?
  50. How do you use the Recovery Console?

 


How do I set DOSKEY?

Type in DOSKEY at the Command Line

You will see DOSKEY INSTALLED and this will record all your key strokes

Back to Top

How do I set the time and date?

DATE or DATE /T to display but does not ask you for a new date

TIME or TIME /T to display but does not ask you for a new time

Back to Top

Where can I find the version of the operating system ?

Type in VER for version on the command line

Back to Top

How do you format a disk?

FORMAT A:

Back to Top

What is the command for checking your directory ?

DIR

DIR /W wide view of the directory

DIR /P /O alphabetical order, one screen at a time

DIR /OD order of date and time

DIR /OS order of file size

DIR /P /O-S lists in reverse order

Back to Top

How do you clear the screen?

CLS

Back to Top

What are the commands for copying a disk?

DISKCOPY A: A:

Back to Top

Closing the Command Window and Session.

EXIT

Back to Top

Save your Doskey history.

DOSKEY^/HISTORY^> ^H:\NAME OF YOUR FILE

Back to Top

What do you do to check your your Doskey history.

DOSKEY^/HISTORY or Press F7

Back to Top

How do you display Attributes in your directory?

DIR /O /P /AH for hidden files

DIR /O /P /AR for read-only files

DIR /O /P /A for all directories and files

Back to Top

What do you use a wildcard* for?

DIR *.XLS /O /P to select all files with the same file extension name.

DIR *PROJECTION.XLS /O /P to select files with the word "projection" anywhere in the filename.

Back to Top

Setting the Windows Environment.

SET to examine the current Windows environment

SET DIRCMD=/P /O to set the pause and alphabetical order

Back to Top

How do you change directories from C: to A:?

CD C:\ 

CD A:\

CD.. takes you back to the next level directory

Back to Top

View the contents of a ASCII text file.

TYPE Templates.txt

Back to Top

How do you use a pipe operator?

The pipe operator | redirects the output produced by one command so that then the output becomes input for another command. For example, the following command will display the output of an ASCII text file one screen or window at a time.

TYPE Templates.txt | MORE

Back to Top

What does the MORE filter do?

The MORE command displays the output of the TYPE command one screen one screen or window at a time.

Back to Top

How do you sort the contents of an ASCII text file?

The SORT filter can take input from a command or a file, sort the input, and then display the results. The R is Reverse Switch.

SORT /R < Templates.txt

Back to Top

Can you search for a text string in an ASCII text file?

The FIND filter searches one or more ASCII text files for a specific string of text and then displays the results by file. 

FIND "Sales" Templates.txt    

Back to Top

What is the command for appending output to an ASCII text file?

To append or add, the output of a command to an existing file.

ECHO.>> "Sales Templates.txt"

Back to Top

How do you redirect output to the printer?

To send output of a command, such as DIR, to the printer, redirect the output with specifying the device name of the printer.

DIR > PRN

Back to Top

How do you create a copy of a file?

COPY is versatile, internal command that you can use in a variety of ways.

COPY "Five Year Plan Templates.xls" "Five Year Plan Draft.xls"

Back to Top

What is the general syntax for renaming files?

RENAME or REN

Back to Top

Can you rename multiple files?

Renames all files that have the first four characters of the filename

REN 2002* 2003*

Back to Top

What commands can I use to delete files?

DEL^ Templetes.doc          DEL ^*.*             DEL^ Templates*              DEL ^*.chk

ERASE Templates.doc

You should always use the Prompt for Verification switch /P to display a prompt before deleting.

Back to Top

How do you MOVE files?

MOVE *.ppt Presentations   -  moves all the files with ppt extensions into a directory called Presentations

MOVE Cashflow.xls Business  - moves the particular file Cashflow.xls into a directory called Business

C:\MOVE Cashflow.xls A: - moves a file from drive C: to the current directory on A:

Back to Top


How do you make a new Directory

MD Designs   - makes a directory called Designs

Back to Top


How do you copy files to a new Directory?

COPY "Final Projects Report.doc: A:\Reports  

Back to Top


What command do you type to view a Directory Structure in Win2000?

TREE

Back to Top


The command to display a directory tree of a Hard Disk.

TREE C:\ /A > hdtree.txt

Back to Top


The command to display a directory tree of your Data Disk.

To view a directory tree of your data disk     CD /D A:\   

TREE /F /A > BEFORETREE.TXT      (/F displays the names of the files in each directory)

Back to Top


What command do you use to remove Directories?

RD /S "New Folder"    (/S displays a prompt that gives only a small margin of safety)

Back to Top


How do you MOVE a directory?

MOVE Training "\My Documents"

Back to Top


How do you MOVE selected files?

MOVE app* Training

MOVE *.* Training

Back to Top


What do you do to Rename a directory?

REN Training Training1

Back to Top


How can I locate files in Directories?

A: DIR Sales*

C: DIR Sales* /S   (/S searches for directories below the root directory)

Back to Top


How do you examine file attributes?

ATTRIB /S | MORE

Back to Top


What is the command for backing up a directory folder?

XCOPY . "A: \Training Normal Backup" /M /S  (the period is the notation of the current directory, the Modify switch /M removes the archive attribute and the Subdirectory switch /S instructs the XCOPY command to copy all subdirectories and their files.

Back to Top


How do you check the boot order in CMOS?

During rebooting watch the screen for information on which key to press it may be <DEL> F1, F2 or F10

Back to Top


To format and copy the System files to a disk you use what command?

FORMAT A: /U /S (/U will erase any information already on the diskette, /S copies the operating system file to the diskette after DOS formats it)

Back to Top


How would you make a Windows setup disk?

Windows:                Run a program in MakeBoot.exe in the Win Folder

Command Line:       CD D:MAKEBOOT A:  

Back to Top


What are some of the contents of the setup disk?

BIOSINFO.INF - info about using Setup, files with the "inf" contain info about configuring hardware/software (Information File)

DISK101 - ids the diskette number in the current set

NTDETECT.COM - checks your computer's hardware during boot up  (Command file)

NTKRNLMP.EX - compressed program file that provides support for multiprocessors ( Executable file)

SETUPLDR.BIN - OS file that loads Win2000 setup (Binary File)

TXTSETUP.SIF - detailed information on installing Win2000 and providing support for hardware devices.  (Setup Information File)

Back to Top


How do you create an Emergency Repair Disk?

NTBACKUP    Click on Emergency Repair Disk option, Insert a disk in Drive A:

Back to Top


How do you use the Emergency Repair Disk?

Boot your computer from the Win2000 setup disks

Setup will ask you if you want to Setup, Repair, or Quit Setup w/o installing Win2000 (Choose Options accordingly)

Back to Top


How do you use the Check Disk Utility?

CHKDSK A: /F  (/F Fix Switch will repair certain types of problems, such as lost clusters.)

Back to Top


How do you use the Recovery Console?

Install the Recovery Console

D:\>\i386\winnt32 /cmdcons

The Installation Dialog Box will pop up and Click on Yes to Install.

Hard Drive:  when you see the OS choices menu press the down arrow Select MS Win2000 Recovery Console

Recovery Console provides a limited set of commands that you can use to repair a Win2000 system that will not start or run properly.

Back to Top

Back to DOS


Disclaimer: This is not intended to be an exclusive and comprehensive guide for the DOS Command Line.

 

Melissa Colon
Columbia College
Revised: August 13, 2004 .