okay. i checked and tryed all the ways to run an exe in the FAQ, but none of them worked. i don't know if those were ment for a C++ program or if it just don't work with my compiler. is there another way. thanks.
Printable View
okay. i checked and tryed all the ways to run an exe in the FAQ, but none of them worked. i don't know if those were ment for a C++ program or if it just don't work with my compiler. is there another way. thanks.
Double click the pretty little icon...
Quzah.
What in gods name are you talking about? How to click and run an exe? How to make one?
??
lol. sorry lookin over it now, forgot to put "Run an exe through another program written in C"
I really doubt you tried all the options in the FAQ then. If you had, you'd have found they all work.
Quzah.
they don't work with me.
I guess I'll use my astounding mental powers to analize the code you have then, huh? I am seeing... Ah, yes, there it is. I see the problem.
Now you can use your astounding mental powers to read my mind, and get the answer.
Quzah.
Assuming that you want to invoke one Win32 program from another, #include <windows.h> and use WinExec("program.exe", SW_SHOWNORMAL);.
>they don't work with me.
Fascinating that they work for everyone who uses them correctly yet you are having problems. The logical conclusion to this is that you're doing it wrong. Post your code and we'll tell you why and how to fix it.
-Prelude
ive tried:
1)
#include <windows.h>
main()
{
WinExec("myfile.exe");
}
2)
#include <stdlib.h>
int main(void)
{
system("myfile.exe");
return 0;
}
and spawn but already trashed that file
also there were some variables i n these but they caused errors when i tried to compile. these all compiled but didn't run the exe
Here ya go:
Save this as 'test.c'. Compile this as 'test.exe'. Run 'test.exe' from a command prompt. Enjoy.Code:#include <stdio.h>
#include <stdlib.h>
int main ( void )
{
printf("Cascading doom.\n");
fflush( stdout );
system( "test.exe" );
return 0;
}
Quzah.
You could include absolute path in system() instead, as:
Code:system("C:\\Workarea\\test.exe");
Ooohh, you're evil ;) :DQuote:
Originally posted by quzah
Here ya go:
<snip code>
Save this as 'test.c'. Compile this as 'test.exe'. Run 'test.exe' from a command prompt. Enjoy.
Quzah.
:D No, I'm being helpful and showing that it does in fact work. (It doesn't in fact work in MSVC++ until you run it from the command prompt rather then the IDE. Very odd.Quote:
Originally posted by Hammer
Ooohh, you're evil ;) :D
Quzah.
that has to do with the IDE search path.. if that is set to the right dir it will work.