I have a question here, I was asked to do but I could not make it:
We are launching default browser using ShellExecute, when using url, with "open" verb, it automatically launch default browser.
Here is the problem for us:
It brings the environment from launching process. Which will causing some problems for the browser.
I have provided following solutions, which are all rejected by the code reviewer:
1>Set back to system environment before we call shellexecute, and then call set environment to restore the environment variables.
2>Using CMD, by using the command "cmd /c <set environments>&&start "link" "www.myurl.com
1> rejected is because it can disturb calling process, 2>Rejected because it need another process.
We do not wanted to call createprocess, because that make things too complicated. So the question is
Anyone knows if there is a solutions to launch a process without inherit environments from parent process? Other than the way that I can think of.
Thank you for any help.
The mechanics of this are circuitously described in this link from Microsoft's MSDN site.