Search This Blog

Wednesday 1 August 2012

MS DOS Comands


MS-DOS

Microsoft DOS (Disk Operating System) is a command line user interface.
While MS-DOS is not commonly used by itself today, it still can be accessed from every version of Microsoft Windows by clicking Start / Run and typing "command" or by typing "CMD" in Windows NT, Windows 2000 or Windows XP.


VARIOUS COMANDS IN DOS MODE:

AT
Schedules commands and programs to run on a computer.

ATTRIB  
Displays or changes file attributes.
Change or view the attributes of one or more files. It defaults to displaying the attributes of all files in the current directory.
Options:
  • To add an attribute attach a '+' in front of it.
  • To remove an attribute attach a '-' in front of it


BREAK    
Sets or clears extended CTRL+C checking.


CALL    
Calls one batch program from another.

CD       
Displays the name of or changes the current directory.

CHDIR   
Displays the name of or changes the current directory.
cd directory
 (cd .. descends a directory.)


CHKDSK  
Checks a disk and displays a status report.
Verifies a hard disk or a floppy disk for file system integrity.
Options:
  • /F : Fixes errors on the disk
  • /V : Displays the full path and name of every file on the disk
chkdsk drive [[path]filename] [/F] [/V]


CHKNTFS
Displays or modifies the checking of disk at boot time.

CLS      
Clears the screen.

CMD     
Starts a new instance of the Windows command interpreter.

COLOR    
Sets the default console foreground and background colors.

COMP     
Compares the contents of two files or sets of files.

COMPACT  
Displays or alters the compression of files on NTFS partitions.

CONVERT  
Converts FAT volumes to NTFS.  You cannot convert the
 current drive.

COPY    
Copies one or more files to another location. The destination defaults to the current directory. If multiple source files are indicated, the destination must be a directory, or an error will result.
copy filespec [destination]


DATE    
Displays or sets the date.

DEL     
Deletes one or more files.
del filename
erase filename
 
DELTREE
Deletes a directory along with all of the files and subdirectories that it contains. Normally, it will ask for confirmation of such a drastic action.
deltree [/y] directory
The /y parameter if present tells the deltree command to carry out without first prompting for confirmation.
The deltree command is not included in recent Microsoft Windows operating systems. Deleting a non-empty directory in those versions of Windows where the command is not included, can be achieved by the use of the rmdir

DIR     
Displays a list of files and subdirectories in a directory.
Options :
  • /w : Wide list format
  • /p : Pause at every page
  • /s : Also look in subdirectories
  • /a[xx] : Display files with the specified attributes only
  • /o[xx] : Modifies sort order
  • /b : Uses bare format (no heading information or summary)
dir [options] [filespec]


DISKCOMP
Compares the contents of two floppy disks.


DISKCOPY
Copies the contents of one floppy disk to another.

DOSKEY  
Edits command lines, recalls Windows commands, and creates macros.

ECHO    
Displays messages, or turns command echoing on or off.

ERASE   
Deletes one or more files.

EXIT     
Quits the CMD.EXE program (command interpreter).

FDISK  
Manipulates hard disk partition tables. The name derives from IBM's habit of calling hard drives fixed disks. When run from the command line, it displays a menu of various partitioning operations:
 1. Create DOS partition or Logical DOS Drive
 2. Set active partition
 3. Delete partition or Logical DOS Drive
 4. Display partition information
 5. Change current fixed disk drive

FIND    
Searches for a text string in a file or files.
FIND [/V] [/C] [/N] [/I] "string" [[drive:][path]filename[ ...]]
 
  /V        Displays all lines NOT containing the specified string.
  /C        Displays only the count of lines containing the string.
  /N        Displays line numbers with the displayed lines.
  /I        Ignores the case of characters when searching for the string.
  "string"  Specifies the text string to find.
  [drive:][path]filename Specifies a file or files to search.
 
If a pathname is not specified, FIND searches the text typed at the prompt
or piped from another command.

FORMAT   
Formats a disk for use with Windows.
Delete all the files on the disk and reformat it for MS-DOS
In most cases, this should only be used on floppy drives or other removable media. This command can potentially erase everything on a computer's hard disk.
Eg.
FORMAT C:     will format the C drive
GOTO     
Directs the Windows command interpreter to a labeled line in a
         batch program.

HELP    
Provides Help information for Windows commands.

LABEL   
Creates, changes, or deletes the volume label of a disk.

MD      
Creates a directory. The parent of the directory specified must already exist.
md directory

MEM 

Displays memory usage.

MKDIR    
Creates a directory. The parent of the directory specified must already exist.
mkdir directory

MODE     
Configures a system device.

MORE    
Displays output one screen at a time.

MOVE    
Moves one or more files from one directory to another directory.

MSD    
Provides detailed technical information about the computer's hardware and software.


PATH    
Displays or sets a search path for executable files.

PRINT   
Prints a text file.

PROMPT  
Changes the Windows command prompt.

RD       
Removes a directory.

RECOVER 
Recovers readable information from a bad or defective disk.

REM     
Records comments (remarks) in batch files or CONFIG.SYS.

RENAME  
Renames a file or files.

REPLACE 
Replaces files.

RMDIR   
Removes a directory.

SCANDISK    
Scandisk is a replacement for the chkdsk utility. Its primary advantages over chkdsk is that it is more reliable and has the ability to run a surface scan which finds and marks bad clusters on the disk.

START   
Starts a separate window to run a specified program or command.


TIME    
Displays or sets the system time.

TREE    
Graphically displays the directory structure of a drive or path.

TYPE    
Displays the contents of a text file.

UNDEL    
Restores file previously deleted with del. By default all recoverable files in the working directory are restored. The options are used to change this behaviour. If the MS-DOS mirror TSR program is used, then deletion tracking files are created and can be used by undelete.


VER     
Displays the Windows version.

VOL      
Displays a disk volume label and serial number.

XCOPY   
Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
                           [/K] [/N]
 
 source       Specifies the file(s) to copy.
 destination  Specifies the location and/or name of new files.
 /A           Copies files with the archive attribute set,
              doesn't change the attribute.
 /M           Copies files with the archive attribute set,
              turns off the archive attribute.
 /D:date      Copies files changed on or after the specified date.
              If no date is given, copies only those files whose
              source time is newer than the destination time.
 /P           Prompts you before creating each destination file.
 /S           Copies directories and subdirectories except empty ones.
 /E           Copies directories and subdirectories, including empty ones.
              Same as /S /E. May be used to modify /T.
 /W           Prompts you to press a key before copying.
 /C           Continues copying even if errors occur.
 /I           If destination does not exist and copying more than one file,
              assumes that destination must be a directory.
 /Q           Does not display file names while copying.
 /F           Displays full source and destination file names while copying.
 /L           Displays files that would be copied.
 /H           Copies hidden and system files also.
 /R           Overwrites read-only files.
 /T           Creates directory structure, but does not copy files. Does not
              include empty directories or subdirectories. 
 /T /E        includes empty directories and subdirectories.
 /U           Updates the files that already exist in destination.
 /K           Copies attributes. Normal Xcopy will reset read-only attributes.
 /Y           Overwrites existing files without prompting.
 /-Y          Prompts you before overwriting existing files.
 /N           Copy using the generated short names


No comments:

Post a Comment