I'm looking for the framework equivilent of either the ShellExec or WinExec
API. Preferably ShellExec because I can use it to launch the default
browser as well as launch executables. thanks.
excerpt from my code:
//-- setting process-options (redirect,noshell,nowindow) for mbinfo.exe
pInfo.UseShellExecute=false;
pInfo.CreateNoWindow=true;
pInfo.RedirectStandardOutput=true;
//-- setting up directory-information for execution
//-- mbinfo.exe -LOGMAX /F serverlist.txt /L email.log /O email.txt
[email protected]("Exchange 5.5", "MBInfo.Path");
pInfo.Arguments="-LOGMAX /F "(e-mail address removed)("Exchange 5.5", "MBInfo.ExtractFile")+" /L "(e-mail address removed)("Exchange 5.5",
"MBInfo.LogFile")+" /O "(e-mail address removed)("Exchange 5.5", "MBInfo.DataFile");
pInfo.FileName=pInfo.WorkingDirectory+@"\mbinfo.exe";
try
{
Log.AddEntry(false, "exchange 5.5", "starting mbinfo.exe...");
MBInfo_Exe=Process.Start(pInfo);
MBInfo_Exe.WaitForExit();
MBInfo_Output=MBInfo_Exe.StandardOutput;
Log.AddEntry(false, "exchange 5.5", "mbinfo-process exited. exit-code:"+ MBInfo_Exe.ExitCode+" output:"+MBInfo_Output.ReadToEnd());
MBInfo_Output.Close();
return true;
}
catch (Exception e)
{
Log.AddEntry(true, "exchange 5.5", "error while executing mbinfo.exe - system-message: "+
e.ToString().Replace("\r","-").Replace("\n","-"));
return false;
}
finally
{
MBInfo_Exe.Dispose();
}
}
(this is formatted, normally)
hth,
crea