Command Language

Command Language


  • Sometimes referred to as a command script, a command language is a language used for executing a series of commands that would otherwise be executed at the prompt. A good example of a command language is Microsoft Windows batch files. Although command languages are useful for executing a series of commands, their functionality is limited to what's available at the command line which can make them easier to learn.

  • Below is an example of a Microsoft Windows batch file that deletes all the files in the Windows temp directory.

    REM Delete Windows temp files.
    echo Deleting Windows temp files.
    cd\window\temp
    del *.* /q

  • Below is an example of a Perl script that performs a similar task as the batch file example, but with more sophistication. In this example, the script not only deletes the files, but creates a log containing information about each file deleted.

    # Delete Windows files and log results into log.txt
    my (@files, $files);
    my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst, $timeoffset);
    ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime;
    $year = $year + 1900;
    @files = `dir /b c:\windows\temp`;
    open(mylog, ">>log.txt") || print "ERROR: $!";
    foreach $files (@files) {
    $files =~ s/\n//g;
    system("del c\:\\windows\\temp\\$files /q");
    print "Deleting $files at $hour:$min:$sec on $mon/$mday/$year\n";
    print mylog "Deleting $files at $hour:$min:$sec on $mon/$mday/$year\n";
    }
    close(mylog);

    Advantages of command languages

  • Very easy for all types of users to write.

  • Do not require the files to be compiled.

  • Easy to modify and make additional commands.

  • Very small files.

  • Do not require any additional programs or files that are not already found on the operating system.

    Disadvantages of command languages

  • Can be limited when comparing with other programming languages or scripting languages.

  • May not execute as fast as other languages or compiled programs.
    Some command languages often offer little more than using the commands available for the operating system used.

  • In conclusion,
    scripts and command languages are very similar. However, scripts or programs offer the user the ability to perform many more commands that would otherwise be executed at the prompt.


    What is an Operating System? » Computer Shortcut Keys and their Functions » Keyboard Function Keys » Computer Basics - Hardware - Software - Parts

    Short Stories for Kids - Moral Stories – English Short Stories for Children - Moral Stories for Kids - Stories for Kids - Funny Story for Kids - Scary Stories for Kids - Really Funny Short Stories - Bedtime Stories
    Proverb Stories
    Powerful Motivational Quotes for Students » Success Quotes » English Short Stories for Kids

    Cabin Crew Jobs & Career Advice » Secretary Job Description » Receptionist Job Description » Top 100 Interview Questions and Answers » How to Prepare for an Interview » How to Write a CV » How to Choose a Career » Computer Shortcut Keys and their Functions

    Scholarships in Australia » Scholarships in Austria » Scholarships in Belgium » Scholarships in Canada » Scholarships in Germany » Scholarships in Ireland » Scholarships in Italy » Scholarships in Japan » Scholarships in Korea » Scholarships in Netherlands » Scholarships in Switzerland » Scholarships in UK » Scholarships in USA

    Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Short Stories for Kids - Moral Stories – English Short Stories for Children - Moral Stories for Kids - Stories for Kids - Funny Story for Kids - Scary Stories for Kids - Really Funny Short Stories - Bedtime Stories
    Proverb Stories
    Powerful Motivational Quotes for Students » Success Quotes »Scholarships in UK »

  • Click here to post comments

    Join in and write your own page! It's easy to do. How? Simply click here to return to Computer Basics FAQ.