Problem while launching an Application through windows service, Process.start() gives an error message

0 views
Skip to first unread message

Madni

unread,
Dec 24, 2008, 12:46:40 AM12/24/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
An eventing service (Project server event handler) is running on
windows 2003 server. This service is running under the user "Network
Service". This eventing service triggers event handlers against
certain events performed on Microsoft Project. The problem occurs when
my event handler tries launching an application under the user
different than "Network Service". Following is the source code using
which i try launching console application under the user which is a
domain admin.

public override void onpublish(PSContextInfo ps,
ProjectPostPublishEventArgs e)
{
SecureString ssPwd = new SecureString();
foreach ( char c in "password" )
ssPwd.Append(c);


Process myProcess = new Process();
myProcess.StartInfo.FileName = @"C:\test\test\bin\release\test.exe";

myProcess.StartInfo.Domain = "myDomain";
myProcess.StartInfo.User = "domainAdmin"; // domain administrator
myProcess.StartInfo.Password = ssPwd;

myProcess.StartInfo.UseShellExecute = false;
myProcess.Start();
}

Fails in launching executable stating "The Application failed to
initialize properly(0xc0000142). Click on OK to terminate the
application"

If I comment out the source lines, those specifying the
username,domain and password, the executable is launched successfully,
but under the user "Network Service". (Like i mentioned earlier the
project server's eventing service is running under "Network Service"
user) But that doesn't fulfill my requirement. It seems the windows
service running under the lower credentials cannot launch the process
with higher credentials. I've searched a lot with the problem with no
result yet .
Any one please help into this ....
Reply all
Reply to author
Forward
0 new messages