FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Win32 C++ problem

 


DivineLight
Hi All,

i am having a bit of problems with my windows application programming. I have a program that should run another program after it has exited properly, How can i do that?
Schedule it somewhere?

Because the other program i want to run will not run until i quit my calling program.

Please help me out, im stuck!
AftershockVibe
Well... there are a few things you can do. Firstly, though there is not way to directly call the second program from the first one after it has finished because (obviously) if the program is not running it can't call anything (because it's not running!).

Secondly, why won't the second program run until the "calling" program has finished? ShellExecute() should work just fine or are the programs using exclusive resources?

Thirdly, and to answer your actual question, yes you can schedule programs from within others. You do need to be an administrator though and WMI needs to be enabled on the machine. Basically, you create a task just before your first program exits which will run the other program in one seconds time.
See here: http://msdn2.microsoft.com/en-us/library/aa394601.aspx

Cool
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.