I am executing this code from MVC website.If i run this code from VS 2012 IIS express it is working but if I host the website on IIS server, it does not work. I tried debugging but there is some error code coming. If I also impersonate my id and pass the my id but all in vain.
Code:
System.Diagnostics.Process proc = new System.Diagnostics.Process();
Char[] chr = Password.ToCharArray();
System.Security.SecureString pwd = new System.Security.SecureString();
foreach (char c in chr)
{
pwd.AppendChar(c);
}
proc.StartInfo.FileName = path to WZZip.exe
//proc.StartInfo.Arguments = -ys20480 pathtosplit landingZone;
proc.StartInfo.UserName = UserName; //Comes from config file
proc.StartInfo.Password = pwd; //Comes from config file
proc.StartInfo.Domain = Domain; //Comes from config file
proc.StartInfo.RedirectStandardError = true;
proc.StartInfo.RedirectStandardOutput = true;
proc.StartInfo.UseShellExecute = false;
bool result = proc.Start();