Introduction to DOS Commands
V E S R N TECHNOLOGIES
Introduction to DOS Commands
DOS CommandsDOS Commands are instructions to perform tasks on files and directories very useful to Windows users. DOS commands are case insensitive. And as you already know, the file is the area where we store a group of information or data, and the collection of a group of files is called a directory.
In MS-DOS the file name follows 8dot format and is divided into two parts – primary name and secondary name. The primary name is up to 8 characters long and the secondary name is up to 4 characters with a dot. For example, in the file-name Logo.jpg, Logo is the primary name and .jpg is the secondary name. Secondary names are fixed for a particular type of file, meaning for system files the secondary name is designated as .sys, for text files it is .txt and so on. To name a file or directory special characters like < > , . / * ? | & Space are not allowed. Here is the list of some of the important types of files with their default secondary names:
Text file --- .txt
Command file --- .com
System file --- .sys
Program file --- .prg
Database file --- .dbm
Library file --- .lib
Batch file --- .bat
Executable file --- .exe
Internal commands are more commonly used and important to the operation and use of the Windows operating system. By embedding them in the command.com file, they can be quickly accessed and always available in MS-DOS and to Windows when needed.
External commands are powerful. They help fix problems, improve performance, and perform other actions as well. External commands usually have higher resource requirements than internal commands. Keeping them in separate files, separated from internal commands, helps to reduce the load on Windows. They can also be added to Windows whenever needed by copying the external command’s file to the computer.
DOS Commands are divided into 2 types:
Internal Commands
Internal Commands are built into the operating system as the part of a file called COMMAND.COM When you type an Internal Command MS-DOS will perform it immediately. All of the internal commands are part of the shell which could be command.com or cmd.exe (depending on your version of MS-DOS or Windows) and are not separate files on the hard drive. As long as you can open a command line you can run any of the internal commands included with your version of MS-DOS Example Of Ms-dos Internal Command Are: CLS – It is a command that allows you to clear the complete contents of the screen and leave only a prompt. BREAK – Break can be used to enable or disable the braking capability of the computer. REN – It is used to rename files and directories from the original name to a new name. CHDIR – Chdir (change directory) is a command used to switch directories in MS-DOS. EXIT – The exit command is used to withdrawal from the currently running application and the MS-DOS session. RMDIR – Removes an empty directory in MS-DOS. DEL- Del is a command used to delete files from the computer. COPY – Allows you to copy one or more files to an alternate location. VOL – Displays the volume of information about the designated drive. TYPE- Display the contents of a text file. DATE – The date command can be used to look at the current date of the computer as well as change the date to an alternate date. TIME – Allows the user to view and edit the computer’s time. DIR – The dir command displays information about files and directories, and how many spaces available. SET – Allows you to change one variable or string to another. MKDIR/MD – Allows you to create directories in MS-DOS. PATH – Path is used to specify the location where MS-DOS looks when using a command. DISKCOMP- Comparing two diskettes. DISKCOPY- Copying a diskette. RD- Remove a directory. These external commands are for performing advanced tasks and they do need some external file support as they are not stored in COMMAND.COM.There are also Batch commands or Batch files which are text files that contain a list of internal and/or external commands which are executed in sequence when the batch file is executed. AUTOEXEC.BAT gets executed automatically on booting. Examples of External Commands are:- DELTREE- Short for delete tree, deltree is a command used to delete files and directories permanently from the computer. TREE- Allows the user to view a listing of files and folders in an easy to read the listing. PRINT – The print command allows users to print a text file to a line printer, in the background. FIND – Allows you to search for text within a file. XCOPY – Xcopy is a powerful version of the copy command with additional features; has the capability of moving files, directories, and even whole drives from one location to another. DISK COMP- Compares the contents of a floppy disk in the source drive to the contents of a floppy disk in the target drive. FORMAT – Format is used to erase information off of a computer diskette or fixed drive. ATTRIB – Attrib allows a user to change the attributes of a file or files. SORT- Sorts the input and displays the output to the screen. CHKDSK- Chkdsk is a utility that checks the computer’s hard drive status for any cross-linked or any additional errors with the hard drive. FORMAT – Format a diskette. PRINT – Printing a file. MOVE- Allows you to move files or directories from one folder to another, or from one drive to another.