Question about running executables from program

This is a discussion on Question about running executables from program within the C++ Programming forums, part of the General Programming Boards category; Ok, this is a completely new territory for me. I want to run a couple of perl executables from my ...

  1. #1
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728

    Question about running executables from program

    Ok, this is a completely new territory for me. I want to run a couple of perl executables from my program using command line parameters inputed by the user. How would I code the following pseudocode assuming the commands would be run from a Windows command prompt:

    Code:
    string program1="perlProgram1.pl";  // cstrings are fine too
    string program2="perlProgram2.pl";
    string program3="perlProgram3.pl";
    
    string param1, param2, param3;
    
    user inputs param1, param2, param3;
    
    runCommandlineProgram(program1+" "+param1);
    WAIT, do not continue until program1 is done
    
    runCommandlineProgram(program2+" "+param2);
    WAIT, do not continue until program2 is done
    
    runCommandlineProgram(program3+" "+param3);
    WAIT, do not continue until program3 is done
    Also, what about doing command line commands such as "md" for make directory and such?

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,659
    Here's most of whats available: FAQ: Run a program from within a program

    gg

  3. #3
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    Thanks for the info, didn't remember there being a faq here for that. That should definately do the trick.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Finding Program Running Time
    By pf732k3 in forum C Programming
    Replies: 6
    Last Post: 03-18-2008, 01:56 PM
  2. Running a program
    By dingolay in forum C Programming
    Replies: 4
    Last Post: 10-01-2006, 09:03 PM
  3. multithreading question
    By ichijoji in forum C++ Programming
    Replies: 7
    Last Post: 04-12-2005, 10:59 PM
  4. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 08:46 AM
  5. question about the loop in case conversion program
    By Elhaz in forum C++ Programming
    Replies: 8
    Last Post: 09-20-2004, 04:06 PM

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