Shell Commands

This is a discussion on Shell Commands within the C++ Programming forums, part of the General Programming Boards category; Is there a site that can teach how to use the shell commands, and what they all are?...

  1. #1
    Programmer Frantic-'s Avatar
    Join Date
    Dec 2004
    Posts
    114

    Shell Commands

    Is there a site that can teach how to use the shell commands, and what they all are?

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Shell commands? For Windows, right? (Based on avatar.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    Programmer Frantic-'s Avatar
    Join Date
    Dec 2004
    Posts
    114
    yes for windows

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Well, CD changes your directory (DOS commands are case-insensitive):
    Code:
    C:\>cd dwk
    
    C:\DWK>
    DIR lists the files in a directory (something like this):
    Code:
    C:\DWK>dir
    
    Volume in drive C: is HARD DRIVE
    Directory is C:\DWK
    
    .         <DIR> 11-11-05 .
    hippo    txt 11-12-05 hippo.txt
    someth~1 bat 10-12-05 something.bat
    
    2 file(s)
    1 dir(s)
    
    C:\DWK>
    To execute a program, like hello.exe, just type the name:
    Code:
    C:\DWK>cd c
    
    C:\DWK\C>hello
    Hello, World!
    
    C:\DWK\C>
    To change drives, type the letter followed by a colon:
    Code:
    C:\DWK\C>A:
    
    A:\>C:
    
    C:\DWK\C>cd \temp
    
    C:\Temp>
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Get a DOS book and read it.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #6
    Programmer Frantic-'s Avatar
    Join Date
    Dec 2004
    Posts
    114
    i mean from within a c++ program.
    I know system(name.exe); (or something like that) launches a program.

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Oh, sorry. Yes, this will launch a program:
    Code:
    #include <stdlib.h>
    system("hello.exe");
    system("hello");
    What else do you need to know about it? You can use any DOS command (if you're on a Microsoft machine) by using system(). (Although some commands have better equivalents, like chdir() instead of CD.)
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows shell commands - multiple files
    By Magos in forum Tech Board
    Replies: 3
    Last Post: 02-28-2006, 12:56 AM
  2. Program to execute shell commands.
    By LiquidLithium in forum C++ Programming
    Replies: 6
    Last Post: 09-01-2004, 12:22 PM
  3. Sending Shell Commands
    By Pudnut in forum C# Programming
    Replies: 2
    Last Post: 08-29-2004, 01:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21