Environmental Sciences, asked by murali6225, 1 year ago

the process object must have the useshellexecute property set to false in order to use environment variables. in c#

Answers

Answered by ritikraj200490
2

The UseShellExecute boolean property is related to the use of the windows ShellExecute function vs the CreateProcess function - the short answer is that if UseShellExecute is true then the Process class will use the ShellExecute function, otherwise it will use CreateProcess.

The longer answer is that the ShellExecute function is used to open a specified program or file - it is roughly equivalnt to typing the command to be executed into the run dialog and clicking OK, which means that it can be used to (for example):

Open .html files or web using the default browser without needing to know what that browser is,

Open a word document without needing to know what the installation path for Word is

Run batch files

Run any command on the PATH

Similar questions