I am using CreateProcess to create a cmd.exe process that is passed a parameter that it executes and quits, this makes command prompt flash up on the screen.
I trie
If its just a console app you can also use the CREATE_NO_WINDOW flag as part of the CreateProcess call itself, e.g.
CREATE_NO_WINDOW
CreateProcess
CreateProcess(NULL, lpszCommandLine, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, NULL, &si, &pi);
Also, see this page for information about environment variables.