I have an MSBuild task that executes (among other things) a call to xcopy. What I have found is that this call to xcopy executes correctly when I run my MSBuild task from a batc
From the Documentation:
Setting this property to false enables you to redirect input, output, and error streams.
Note: UseShellExecute must be false if the UserName property is not a null reference (Nothing in Visual Basic) or an empty string, or an InvalidOperationException will be thrown when the Process.Start(ProcessStartInfo) method is called. When you use the operating system shell to start processes, you can start any document (which is any registered file type associated with an executable that has a default open action) and perform operations on the file, such as printing, with the Process component. When UseShellExecute is false, you can start only executables with the Process component.
Note: UseShellExecute must be true if you set the ErrorDialog property to true. The WorkingDirectory property behaves differently when UseShellExecute is true than when UseShellExecute is false. When UseShellExecute is true, the WorkingDirectory property specifies the location of the executable. If WorkingDirectory is an empty string, the current directory is understood to contain the executable.
When UseShellExecute is false, the WorkingDirectory property is not used to find the executable. Instead, it is used by the process that is started and has meaning only within the context of the new process.