Thread: Equivalent of BASIC's run?

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912

    Equivalent of BASIC's run?

    Is there an equivalent of the run statement in BASIC? It's a statement that will run another program. Will it return to the system afterwards, or will it go back to the program.

  2. #2
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    spawnf()

    It is in process.h

    It can run DOS or Windows programs.

    You can also use system() which accepts dos commands. So if you used system, you would do:

    system("cd\windows\myprog.exe");

    I use both. spawnf() is the more correct way to run EXE's.
    My Website

    "Circular logic is good because it is."

  3. #3
    Just one more wrong move. -KEN-'s Avatar
    Join Date
    Aug 2001
    Posts
    3,227
    don't you mean

    system("c:\\windows\\myprog.exe");

    ?


  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    Thanks - system() sounds like what I was looking for (even better actually), but do I need to double up on the \'s and all the other escape sequences?

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > but do I need to double up on the \'s and all the other escape sequences?
    Yes

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Re-doing a C program to run in Win2000 or XP
    By fifi in forum C Programming
    Replies: 5
    Last Post: 08-17-2007, 05:32 PM
  2. how to run an exe command in c++ and get back the results?
    By mitilkhatoon in forum C++ Programming
    Replies: 5
    Last Post: 09-21-2006, 06:00 PM
  3. calculating the mode
    By bigggame in forum C Programming
    Replies: 10
    Last Post: 06-13-2006, 03:04 AM
  4. How I can Run exe file in C++
    By palang in forum C++ Programming
    Replies: 2
    Last Post: 05-10-2006, 11:55 AM
  5. Replies: 2
    Last Post: 10-29-2002, 04:56 PM