Re: Process.Start() in windows service on Windows Server 2003, problem

From: Tobias Johansson (no)
Date: 02/23/05


Date: Wed, 23 Feb 2005 17:07:54 +0100

Thank you for your reply,

I have tried both your suggestions,
but a can't get it to interact with the desktop. (no cmd window starts)
The cmd starts but not ExtExp.exe (monitored in task manager)

And I get no exceptions running it in remote debug mode.

I also made the extexp write to a log file the first thing it does..
nothing is in the log file after a run attempt .. wich means the program
never actually runs.

If you have any other ideas, they are greatly appreciated.

Thank you once again for your time.

"Pavel Lebedinsky" <m_pll at hotmail com> skrev i meddelandet
news:ujZs6GXGFHA.3732@tk2msftngp13.phx.gbl...
> So it looks like the process starts successfully but then terminates
> for some reason. May be it doesn't like the service environment
> or something like that.
>
> You could try configuring the service to run as System and enabling
> the "allow to interact with desktop" checkbox. Then you should be
> able to see your process window while it's running. If it goes away
> too quickly change the command line to something like
> "cmd /k test.cmd" and put the actual command in the test.cmd file.
>
> Another option is to run your process under the built in debugger
> (ntsd.exe) to see if you're getting any exceptions. You'll need to use
> the -server and -remote options to connect to the debugger session
> (unless you change your service to be interactive as described above).
>
> "Tobias Johansson" wrote:
>
>> I tested with notepad before and it worked,
>> but I can't actually see it because the program is running as a windows
>> service.
>>
>> However I tried it again today with the same result.
>> I also tried with ipconfig.exe and it worked without problem
>> and I got the output of my ip configuration in my log file.
>>
>> I also corrected the deadlock issue,
>> to read the stream before exit. Thanks pointing that out.
>>
>> I know win 2003 server has extra security on running exe files mapped on
>> network drives
>> but this is not on a mapped drive, it's local.
>> But coul'd it be related ? but then console program wouldn't have worked
>> either...?
>>
>> I have also tried setting the current work dir of the service to the work
>> dir where the exe is
>> before executing it .. no change..
>>
>> I have also checked the permissions on the file
>> and that the user that the service runs as has access to it (currently as
>> local admin just to make it work)
>
>



Relevant Pages

  • [Full-Disclosure] Surgemail - Multiple Vulnerabilities
    ... disclosing physical directory structure. ... check for a log file in the scripts directory ... and run the process in a shell window " ...
    (Full-Disclosure)
  • Re: CreateProcess - Different User
    ... If I set lpDesktop to "WinSta0\Default" I get an eror on CreateProcess ... I check "Interact with desktop" for the service that launches the ... but it doesn't have a window). ...
    (microsoft.public.win32.programmer.kernel)
  • Re: sendkeys to open the command window
    ... I calling that sendKeyTest method using .net remoting. ... If you want to have an application interact with a service, ... window service is also checked. ... sendKeysTest is defined inside the window service. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: sendkeys to open the command window
    ... If you want to have an application interact with a service, ... window service is also checked. ... sendKeysTest is defined inside the window service. ... I can see cmd in my task manager that it is started, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Navigating between active sheets using the Window dropdown.
    ... So do you want the _Window menu option to expand if the user ... responds "Yes" to the message box that asks "Is today's log file ... files to select the correct sheet for the macro to run on. ...
    (microsoft.public.excel)