The quick answer to your question is "Well, no, you can't prevent an application from being executed". If it is an executable, then it can be executed. No way to stop that.
And, if you can't control the application (as your comments seem to indicate) then Gs's excellent suggestion won't work, right? You don't have any way of controlling what the app does and you can't control it's reaction to your special command line.
So this does present an interesting situation.
The only way I see around this is to prevent access to the EXE altogether, or at least make it hard to find it.
You could do this:
- Embed the EXE into your host EXE as a resource
- When the time comes to run the EXE, then extract it using TResourceStream
- Write it out from the TResourceStream using TFileStream
- Execute it
- Delete it when you are done.
Not pretty, but it is the only way I can think of to keep the EXE from being run on your terms and your terms only.