• C

Execute a Application from a C program

HI

I have a requirement of executing a internet explorer from a C program with a BMP name as parameter.
can you please let me know the function call to do that.

Thanks

s_syedAsked:
Who is Participating?
 
AjarConnect With a Mentor Commented:
solution :

instead of

>>char command[] = "L:\\program files\\Internet Explorer\\iexplore.exe x:\\paradise.jpg";

use

>> char command[] = "\"L:\\program files\\Internet Explorer\\iexplore.exe\" x:\\paradise.jpg";
0
 
sunnycoderConnect With a Mentor Commented:
Hi s_syed,

use system("path_to_explorer...");

system is used to launch programs from a C program

Cheers!
Sunny:o)
0
 
s_syedAuthor Commented:
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
char command[] = "L:\\program files\\Internet Explorer\\iexplore.exe x:\\paradise.jpg";
int main()
{
      cout << "Inside main" << endl;
      
      system(command);
      return 0;
}

i tried like that and got an error as

Inside main
'L:\program' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue

0
 
rita_512Commented:
or else u cud use

char command[]="C:\\PROGRA~1\\INTERN~1\\IEXPLORE.EXE C:\\test.jpg";

shud work as fine.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.