Skip to main content
Home
Live to Learn!

Main navigation

  • Home
  • Learn
    • FoxPro
    • MS-DOS
    • C PRG
    • Java
    • ASP
    • Ruby on Rails
    • ASP.NET
    • E-Books
    • Exam Preparation
    • Tools
  • Blog
  • Forums
  • Contact
User account menu
  • Log in

Breadcrumb

  1. Home
  2. MS-DOS

External Commands

Book navigation

  • Introduction
  • DOS commands
  • Changing command prompts
  • External Commands
  • DOSKEY Command
  • Batch Files
  • Conditional shutdown batch file
  • Windows Command Reference
  • Beware of Batch file Virus
By Karthik , 25 October, 2011

EXTERNAL COMMANDS

The external commands are not built in the file command.com.
Each and every external commands need a separate file to execute them.

Attribute of a file
A bit in a file specification is used to indicate whether the file can be displayed.
    
Syntax:-
attrib <options> <filename>    

Options:-
                   
    +R =>  read only file attribute
    
    -R  => clear read only file attribute
       
    +H => hidden file attribute

    -H => clear hidden file attribute
Find:-

    This command is used to search for a pattern in a file.

Syntax:-
           find "pattern" <filename>/[options]    
       
options:-
I => Ignore case, it will search for the given pattern inlower and uppercase
N => to display only the number of times the pattern occurs.
C => to display only the number of times the pattern occurs.
V => to display only all the lines that do not contain the pattern.

SORT:-

The sort command is used to sort the contents of a file or piped input in either descending or  ascending manner.

Syntax:-

    sort<filename><options>

Example
        c:\>sort  hello

        c;\>sort  /+2 hello

        c:\>sort /r hello
MORE:-

    We can display all the files in page by page manner.

    syntax;-
              more<filename>
    example
        c:\>more  mydoc

FC(file compare):-

    The fc command is used to compare the contents of two files.

    Syntax:-
        fc<filename><filename>

    Example
        c:\>fc mydoc1 mydoc2


Move :
    It is used to move a single or a  group of files from one directory to another directory.
    
    Syntax:-

     move<filename><destination-directory>

    Example:
       
        c:\>move myfile d:
    
    
TREE

    The tree command which is provided by TREE.com file,is used to display a graphical tree view of the directory.

Syntax:-
      tree[path][/options]
 Example:-

    c:\tree

      To  display the tree view of the current directory and directories under neath the current directories.

    c:\tree\new

    To display all the files and directories of the directory NEW and underneath the  directory specified.

    c:\tree/f
        it is used to display files.



XCOPY:-
    
    It is used to copy files and subdirectories from one location to another.

    Syntax:
    xcopy<sourcedrive><directory><target drive/directory>

      Example:-
                xcopy c:\hai  d:\hello

DELTREE:-
         
      The deltree command is used to delete the entire directory structure from the path you give,provided by deltree command.it deletes all the files and subdirectories underneath the given directory including the directory specified.

    Syntax:-
        deltree<path><enter>

    Example:-
        c:\deltree hai

Comments

Featured Blog Posts

Convert Currency in Number to Words (Indian Rupees) - MS Excel
Foxpro Tutorial and Programs
Convert Currency in Number to Words in MS Word
Convert Currency in Number to Words (Indian Rupees) - Version 2
Best way to Use Rupee Symbol in Windows – Easy steps
Convert Currency in Number to Words - MS Access
Creating All in One Windows XP DVD with all Important Applications
RSS feed

© 2009-2025 Live to Learn.In

Terms of Use | Privacy Policy