cannot launch exe from windows service??
-
ok, so i know it's some sort of permission problem i'm having, but i can't quite figure out what exactly i need to do to get this working. my windows service is starting a new Process object and launching an EXE. this exe is not getting called, but as a test i confirmed that i am able to launch things like notepad and perfmon from this service. i think i know what the problem is, but i just can't figure out how to fix it. my service is set to run under local system, and i believe the EXE i'm running is not running correctly because it needs resources that can only be accessed from the user account. is this correct? i've confirmed my code works by running the same code in a console app, and the exe successfully is called. it just won't get called from my exe! any ideas? thax!
-
ok, so i know it's some sort of permission problem i'm having, but i can't quite figure out what exactly i need to do to get this working. my windows service is starting a new Process object and launching an EXE. this exe is not getting called, but as a test i confirmed that i am able to launch things like notepad and perfmon from this service. i think i know what the problem is, but i just can't figure out how to fix it. my service is set to run under local system, and i believe the EXE i'm running is not running correctly because it needs resources that can only be accessed from the user account. is this correct? i've confirmed my code works by running the same code in a console app, and the exe successfully is called. it just won't get called from my exe! any ideas? thax!
Have you tried setting up the service to run as a specific user account, for instance the account you used to confirm that the EXE would start successfully? You should only do that as a test, by the way. If it does turn out to be a permission issue, a new account or group should be created with the least necessary permission(s) to use the EXE.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
Have you tried setting up the service to run as a specific user account, for instance the account you used to confirm that the EXE would start successfully? You should only do that as a test, by the way. If it does turn out to be a permission issue, a new account or group should be created with the least necessary permission(s) to use the EXE.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
yeah, i tried running it as the user that i run the exe manually successfully from. still doesn't work. i even tried setting it to networkservice, and that didn't even run at all cuz of permission issues... what else is there to try??
Well, are you logging events on the service? If so, are there errors getting logged? Do you know for certain that the executable is not getting started? I don't know what it is you're trying to do, or what the executable is, so it's hard to make suggestions, but if you don't have some form of logging in place, then I would recommend adding some and seeing if anything comes of it. Good luck.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
-
Well, are you logging events on the service? If so, are there errors getting logged? Do you know for certain that the executable is not getting started? I don't know what it is you're trying to do, or what the executable is, so it's hard to make suggestions, but if you don't have some form of logging in place, then I would recommend adding some and seeing if anything comes of it. Good luck.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
i saw some winsock errors in the eveentlog associated with my service. theh exe i'm running is an exe that communicates with a server. so it opens up a tcp connection to a remote macine and sends some data... the fact that this is not easy to get working seems to be a GOOD thing, since this is typical action of some malicious service i would assume... i've spent a lot of time on this and i'm thinking it might be just easier to communicate with the natice c++ written in win32 code directly. then this way i would avoid haveing to spawn a new process and execute it, which is what's causing these security problems, right? so i can either covert this win32 exe into a DLL or a com object and talk to it using .net's com interop or dill importing attributes. which one is easier? -- modified at 11:00 Sunday 22nd January, 2006