Hello,

I am a new beginner to c++. I am trying to launch an application in using the following command:

system("clip100.txt")

File clip100.txt got opened on my word processing software running and i had to exit from word processing to get my program continued.

My question is: How can i get my file clip100.txt ( or similar with different format, ex mp4) opened and allowing my application program to continue running passed the system("clip100.txt") line.

I was told about a command "Createprocess" but i cannot find documentation about it.

My purpose is to visually observe the opened file( txt, mp4 movie) while the my application program is prompting me with different inputs request i have to answer.

Thank you

monere.

Hello,

I am a new beginner to c++. I am trying to launch an application in using the following command:

system("clip100.txt")

File clip100.txt got opened on my word processing software running and i had to exit from word processing to get my program continued.

My question is: How can i get my file clip100.txt ( or similar with different format, ex mp4) opened and allowing my application program to continue running passed the system("clip100.txt") line.

I was told about a command "Createprocess" but i cannot find documentation about it.

My purpose is to visually observe the opened file( txt, mp4 movie) while the my application program is prompting me with different inputs request i have to answer.

Thank you

monere.

Well, u shouldent really use system(...)

but thats the easiest way as a begginner

so do this:

system("start clip100.txt");

system()
is like calling the command prompt and typing in so i recomend you go to start->run -> cmd.exe
in that type in help
press enter and you will get a bunch of commands
with every command type the command and /?
to get info on how to use that command.

You can use the command in the program using system("...");

Hope that helps : )

#include <windows.h>

using namespace std;

int main()
{
    ShellExecute(NULL, "open", "C:\\cool.txt","", "C:\\", SW_NORMAL);
    return 0;
}

Comatose,

I tried your solution. it worked perfectly the first try.
I will check documentation to gain a better understanding of the Shellexecute "functions".

I also thank other members of this forum who provided me with interesting answers and insight to the problem i was facing.
Thanks a lot

Monere

This article has been dead for over six months. Start a new discussion instead.