Please excuse me if I am asking a dumb question as I am a novice programmer on C#.
I am seeing different behavior of Process on Windows Server 2008 and 2003.
Below is my code snippet:
Process job = new Process();
job.StartInfo.FileName = global.m_sShell;
job.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
job.StartInfo.Arguments = EXE;
job.StartInfo.UseShellExecute = false;
job.StartInfo.RedirectStandardError = true;
job.StartInfo.RedirectStandardOutput = true;
job.StartInfo.RedirectStandardInput = false;
shellScriptRetCode = job.Start();
"global.m_sShell" is a string that contains a system path like "E:\abc\ksh.exe". [This string has been fetched from a registry key]
The process starts well on Windows Server 2008 but on Windows Server 2003 (32-bit) I am getting error
The system cannot find the file specified
I have checked the file manually and it exists on the server. Now, if I hard code the filename like:
job.StartInfo.FileName = @"E:\abc\ksh.exe";
it works fine.
The thing is that I have to fetch the path key from registry and use that to launch the process.
Please provide me with your expert comments.
Thanks!