-
opening an external file
I am just learning C++ and I was wondering, is there a way to make a .exe file that when ran automaticlly opens a .html document? I'm asking becaue I am putting thewebsite for my business on CD-Rom and autoplay only works for .exe and .com(Ithink) extensions, but not .html.
I need to be able to have Autoplay.ini open auto.exe which opens index.html automaticlly.
Thank You for any help,
-
look up ShellExecute() on MSDN
-
I am not sure but i think u can use the system function
PHP Code:
#include <iostream>
using namespace std;
int main ()
{
system("file.html");
return 0;
}
-
-
I tested it, and it works fine!! :D
-
not on my computer, punk!
-
i tested on Dev-C++ and Borland 6, and its working on both!!
i am using XP but i dont think that makes a different.
-
Here is the exe file in case u dont believe me! :P
-
that exe did nothing - it just quit as soon as i opened it
-
There should be a file named with "file.html" in the same directory where the executable is! or it will open nothing!
-
it definatly works for me