Hi,
I try to run a DOS command from a win services
the command :
DTExec.exe /DTS "\MSDB\FileName" /SERVER IP /CONFIGFILE "Path"
However the command works on cmd but not in the code using
System.Diagnostics.ProcessStartInfo object,
I tried to set account :
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo(fileName ,
command);
GetUser(ConfigFile); // get user Doamin and pass form
XML FILE
foreach (char c in PassWd)
spwd.AppendChar(c);
procStartInfo.Domain = Domain;
procStartInfo.LoadUserProfile = true;
procStartInfo.UserName = user;
procStartInfo.Password = spwd;
procStartInfo.RedirectStandardOutput = true;
procStartInfo.RedirectStandardError = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = false;
System.Diagnostics.Process proc = new
System.Diagnostics.Process();
proc = Process.Start(procStartInfo);
…
Error : access denied
the Win Service runing under ServiceAccount.LocalSystem
any idea ??
THX