Start process from System Account with a specific User Name
I'm developing a windows service in C#.net
, Account: LocalSystem
, System: Windows XP SP3
I provide domain, name, password, but Start() throws Win32Exception exception "Access is denied"
process.StartInfo.Domain = domain;
process.StartInfo.UserName = name;
process.StartInfo.Password = password;
process.StartInfo.FileName = fileName;
process.StartInfo.UseShellExecute = false;
process.Start();
The user whose credentials I provide is in administrator group - the application successfully runs if started manually.
Is this accompli开发者_运维问答shed in a different way?
Thank you!
How are you checking for applications which are running? In Windows Vista and newer, there is separation between the services and desktops. This may mean that you cannot access the desired information and the service is bombing out for that reason. There is an 'allow interaction with desktop' or similar check box in the service dialog. You might want to try enabling that.
精彩评论