Process.Start filename using %temp%
Date : March 29 2020, 07:55 AM
hope this fix your issue The Process class does not expand strings with environment variables (i.e. %temp%). If you want to use environment variables to build the FileName property then you'll have to get the environment variables (using the GetEnvironmentVariable method on the Environment class) and perform the substitution yourself, like so: // Construct the path.
string temp = Environment.GetEnvironmentVariable("temp");
string path = Path.Combine(temp, "SSCERuntime_x86-ENU.msi");
// Launch the process.
Process p = new Process();
p.StartInfo.FileName = path;
p.StartInfo.Arguments = "/passive";
p.Start();
p.StartInfo.FileName =
Environment.ExpandEnvironmentVariables(@"%temp%\SSCERuntime_x86-ENU.msi");
|
process.start from a variable location %temp%
Date : March 29 2020, 07:55 AM
it fixes the issue I have the program unzipping the file to %temp%\myfolder\ , First set the Environment.CurrentDirectory = Environment.GetEnvironmentVariable("temp")
' Possible variables include temp, tmp, and windir for examples.
Environment.CurrentDirectory = Environment.GetEnvironmentVariable("temp")
Process.start("myfolder\start.cmd")
|
PSRemotingTransportException when calling Start-Process "MsiExec.exe" on remote machine
Date : March 29 2020, 07:55 AM
may help you . The best answer I could find is that my uninstall is resetting IIS, which causes my Powershell Remoting connection to be severed. This is what I did as a work around:
|
Powershell Start-Process msiexec on a remote machine not working
Date : March 29 2020, 07:55 AM
it helps some times It seems the problem was a combination of how the msi installer was build and the restrictions windows server has towards interactive processes. I ended up using psexec to bypass this problem.
|
Trouble with process.start()
Date : March 29 2020, 07:55 AM
seems to work fine WorkingDirectory isn't the path where the .exe is located, it's the path that will be used as the "current" directory for the application once it starts. By default, it's the same folder as the folder where the .exe is located. For example, when you open a console window to your project folder and execute a command like msbuild, the working directory is your project folder while the executable's path is always somewhere in the .NET SDK. process.StartInfo.FileName = Path.Combine(directoryRemote,FileNameRemote)
|