I am currently working on a program that would run other application under given virtual environment. I am running another application like so:
Process app = new Process();
app.StartInfo.FileName = @"W:\path\to\app\some.exe";
app.EnableRaisingEvents = true;
app.Start();
Now I have faced an issue to change some system variables for application to be run. I have googled for this and could not found the solution. Anybody has any idea how to solve this problem, please help me?
Thanks.
Update
For example I want to set another PATH
, JAVA_HOME
, AppData
variable for child application. Application could be: Google Chrome
, Notepad++
or simple .bat
script for command line.