Basic Idea of Command Prompt


The Command Prompt

Windows provides a command prompt interface that enables you to enter text-based commands or run command-line tools. Command-line tools accept only text input, and they output information either in text format or by opening a graphic display window. You can use command-line equivalents of graphical tools to create batch programs or scripts that automate administrative tasks. Some Administrators and Power Users might also find command-line management to be more streamlined and efficient than working through a graphical interface.


Figure: The command Prompt interface.


  • The default path in Windows 7 for the prompt is the user profile folder for the current user (C:\Users\username).In Windows XP, the default path is C:\Documents and Settings\username.
  • Because you can run DOS-type commands at the command prompt, it is sometimes casually called the “DOS prompt.”

Command Interpreters

Windows provides several different command interpreters. The typical command prompt interface is the standard Windows command interpreter, available in Windows XP and Windows 7. To access the command prompt interface, you can either run cmd.exe or choose the Command Prompt shortcut from the Accessories menu. Windows XP also includes the DOS command interpreter,, to support running DOS-based applications with an MS-DOS subsystem. There are also the Windows PowerShell and Windows Recovery Console, used for more high-level administrative tasks.

Sample Command-Line Tools

The following table gives some examples of common command-line tools you can use to manage Windows computers.

Because the syntax for a tool might vary slightly between operating systems, you should check online help for the exact syntax. To view online help at the command prompt, enter the command followed by a forward slash and a question mark (for example, format /?). For a list of all the available commands, type help at the command prompt.

Tool, Function and Syntax

Dir –  List the contents of a directory (folder).

Syntax: dir [path][switches]

Cd or ChDir – Change to another directory.

Syntax: cd drive:path

Copy – Copy files.

Syntax: copy source destination

Del or Erase – Delete files.

Syntax: del filename or erase    foldername

Md or MkDir – Create a directory.

Syntax: md foldername or mkdir    foldername

Rd or RmDir – Delete a directory.

Syntax: rd foldername or rmdir    foldername

Rename or Ren – Rename a file.

Syntax: rename drive:path oldfilename newfilename

Syntax: ren drive:path oldfilename newfilename

Type –  Display the contents of a text file.

Syntax: type drive:path filename

Ver –  Display the operating system version.

Syntax: ver

Running the Command Prompt

How You Do It

1. Run the command prompt.

a. Choose StartAll ProgramsAccessories.

b. Click Command Prompt.

c. Maximize the Command Prompt window.

2. Enter commands at the prompt.

a. To display the current operating system version, enter ver

b. To change to the root of the current drive, enter cd \

c. To see the contents of the current folder, enter dir

3. Create a folder using the command prompt.

a. At the C:\> prompt, enter md LocalData

b. To verify that the folder is created, enter dir


c. To close the Command Prompt window, enter the command exit

                                                                    ———————- Thanks


About Author


1 Comment

  1. Avatar
    sorfuddin ahmad on

    I think command line prompt is most effective for microsoft OS,so your post is useful for microsoft OS users. so dear thanks for your post. I hope you will post next time any computer related information.

Leave A Reply

CAPTCHA ImageChange Image