Re: Starting a process "cmd.exe" from within a service...



Hi !

Just a thought. I am not familar with the process properties in .Net 2.0 [what looks you are using].
Each started process needs some desktop and you are possibly on the way to start the new process in the same desktop, as the starter has. In case of the started process users identity do has less rights than the starter, it cannot access the startes desktop/winstation.

I found this starting processes with WMI, while I was logged on onto the console as an admin, I tried to start a visible process with less rights, which always fails for the mentioned reason. I used sysinternals winobj then to modify the security attributes on the consiole users dektop and this helped.

For process in .Net 2.0, I don't know.
As I said, just a thought.

Best regards,
Manfred

Marius wrote:
I'm running a serice under a local admin account. The service runs specific DOS commands (eg. "dir c:\") upon request using "cmd.exe". I create a ProcessStartInfo and enter the user credentials in the UserName, Password and Domain fields. The start the process using the ProcessStartInfo. However, running the process just hangs. I can see the "cmd.exe" process that has started (task manager) using the specific user credentials, but it just hangs.

If I do not impersonate the user in the service, all runs fine.

When I run the exact same service code as a console under the same credentials as the service, then the process runs and returns results. Any reason why the process would hang when running the service vs console?


.



Relevant Pages

  • Samba server hangs
    ... I have a Samba 3 / FreeBSD 5.4-RELEASE-p6 server that hangs I think, ... I can't type anything at the console. ... * At the console I can scroll up and down with scroll lock. ...
    (freebsd-questions)
  • Re: Hang in 2.6.23-rc5
    ... System hangs (caps lock and scroll lock leds are both flashing). ... Hmm, just occured here, no chance to capture anything. ... Make sure you've set your console loglevel high enough to log ...
    (Linux-Kernel)
  • Linux Console Hangs
    ... hangs as soon as I type the password even as root. ... Webmin there and they both work very well but sshd and sendmail don't ... - every login hangs the session the same way as on the console. ...
    (comp.os.linux.networking)
  • Re: EM stability
    ... I don't have a serial console, just a graphic console. ... the file stops updating when the machine hangs. ...
    (freebsd-net)
  • Re: EM stability
    ... I don't have a serial console, just a graphic console. ... the file stops updating when the machine hangs. ...
    (freebsd-stable)