Linux
Windows 2000
Command Prompt

Regulations
General Info
Hardware
Software

Roaming Profile
Exam Papers

System Support

Links

The Command Prompt

What is the command prompt?

To understand what the command prompt is requires a little background information. On each occasion that a user clicks on the user interface a command is executed. This may be for something as trivial as opening an application. Clicking on some area of the screen using graphically pleasing menus or buttons, is easier for the user rather than typing lines of commands. However the option is there for the user to type commands rather than use the GUI(Graphical User Interface). This is the command prompt. There will be occasions when it may be more benefical to type the commands at the command prompt rather that use the predefined commands behind the menus or buttons.

To open the command prompt, from the start menu select start->programs->Accessories->command prompt .The procedure can be seen below.

Alternatively you can start the command prompt by selecting run from the start menu and typing cmd. The procedure is shown below.

Once you have launched the command prompt it should look like the following.

You are now free to type commands and press return to have them executed.

Command prompt tips and Tricks

To change from window to full screen mode do the following.

  • Make sure the command prompt has the focus
  • Hold down the Alt key and press the Enter Key. The Command Prompt should switch to full screen mode.
  • To go back to window mode press Alt + Enter again.

How do I change the appearance of the command prompt?.

  • Using the mouse right click on the command prompt title bar
  • choose the properties option
  • From the options provided choose the one which you prefer.

How do I change the command prompt?.

  • Open the command prompt
  • Type the following prompt followed by the format characters for your new prompt. For example PROMPT $t $p $g
  • To view the various options for the prompt command type "PROMPT/?" without the quotes and press ENTER):

Top ten Commands

One of the main problems that users experience with entering commands straight from the keyboard is that they are difficult to remember. So here are some of the commands that you may encounter.

COMMAND DESCRIPTION
cd change directory
dir show directory contents
copy copy file from one source to another
del delete file
move move file from one location to another
ren Rename a file
cls Clear the command prompt window
deltree delete file
format Format the drive
edit Edit computer files

cd:change directory

CD (Change Directory) is a command used to switch directories.

cd workarea changes directory to workarea.
cd c:\winnt changes directory to winnt from any location.
A: changes to drive A:\ C: changes to c:\ and so on.

dir:View contents of directory

The dir command allows you to see the available files in the current and or parent directories.The dir command is built into the command.com which means this command is an internal command and is available in 98/95 nt and 2000

dir a:\ lists all the contents of the floppy.
dir /s Lists the files in the directory that you are in and all sub directories after that directory
dir /p Lists all files one page at a time.
DIR \ /S |FIND "i" |MORE list all directories on the hard drive, one screen page at a time.

Copy:Copy file

Allows the user to copy one file from one source to another.

copy *.* a:Copy all files from current directory to the floppy disk in drive a:
copy a:\dummy.txt c:\winnt copies dummy.txt from the floppy to c:\winnt.
copy win.ini c:\windows /y This would copy the win.ini file to the windows directory

Del:delete file

Del which is short for delete and is a command used to delete files permanently from the computer.

del test.tmp Deletes the test.tmp in the directory that you currently are in, if the file exists.
del c:\windows\test.tmp Delete the c:\windows\test.tmp in the windows directory if it exists.
del c:\windows\temp\?est.tmp Delete any file ending with est.tmp such as pest.tmp or zest.tmp...

move:move file

Allows you to move files or directories from one folder to another or from one drive to another.

move c:\windows\temp\*.* c:\temp This would move the files of c:\windows\temp to the temp directory.

Ren: rename File

Used to rename files and directories from the original name to a new name.In earlier releases of MS-DOS instead of using ren or rename you need to use the move command to rename your MS-DOS directories or files.

rename c:\chope hope Rename the directory chope to hope.
rename *.txt *.bak Rename all text files to files with .bak extension.
rename * 1_* Rename all files to begin with 1_. The asterisk (*) in this example of a wild character

cls: clear screen

Cls is a command which allows the user to clear the complete contents of the screen and leave only a prompt.

cls clears the command prompt.

deltree: delete file tree

Deltree which is short for delete and is a command used to delete files permanently from the computer.

deltree c:\windows\fake010 Deletes the fake010 directory and everything in it.

format: Format Drive

Format is used to erase all of the information off of a computer diskette or fixed drive.

format a: Would erase all the contents off a disk in drive a:\.

edit: edit computer files

Edit allows a user to view, create and or modify their computer files. If you are unable to get this program to run work try typing in "path c:\windows\command" if you have Windows95/98 or type in "path c:\dos", if you have Dos 5.x/6.x/7.x or Windows 3.x and try again if still you are not able to get edit to work it may not be on the hard drive type in dir edit.com /s at the c:\> if it says that the file is not found you may not have this feature. If you are running a MS-DOS version 4.x or lower or you are unable to find edit.com on your hard disk drive you can also use the following command to create a file. copy con Once you have entered the above command this will create the file by the name specified. Once you have typed all the lines you wish to be in the file press and hold CTRL + Z. This should enter ^Z, once on the screen press the enter and one file should be copied.

References

Command Prompt Reference



Department of computer science and information systems
University of limerick, limerick, Republic of Ireland

Department of Computer Science and Information Systems, University of Limerick, Limerick, Republic of Ireland
Valid HTML 4.01! Valid CSS!