locked
Running a console app from Windows Service RRS feed

  • Question

  • I'm building an application which uses the console interface of the Nokia Multimedia Converter and passing in switches to control the resultant file. I can currently run this in 2 ways:

    1. Straight from the command line (manually). Using this method it takes about 4 seconds to complete.

    2. Running an application which starts the Converter as a new Process and passes in the switches through the command line arguments method. This requires a similar amount of time to 1.

    However, I actually want to run the app as a Windows Service. When I start the Converter off as a new Process from within the Service and pass the switches/arguments (exactly the same code as used in 2) it can take up to a minute to return the resultant file.

    Can anyone explain to me why there is such a difference in processing time and how I can reduce this?

    Monday, January 29, 2007 8:19 PM

Answers

  • It was just a guess, to be honest. I think your only other alternative is to throw some logging in a script or the service, and see how much of the time is actually spent inside the spawned process. That, or run it in the debugger and profile from there.
    Tuesday, January 30, 2007 6:34 PM

All replies

  • I would be interested to see if changing the account that the service is running under to the user account that currently owns the interactive session would affect the time it takes to spawn the process and write the resulting file. Just a shot in the dark.
    Tuesday, January 30, 2007 2:53 AM
  • The service currently rnus under the System account. If I change it to any of the other accounts then I lose access to SQL Server.

    Should this be the case and which account would you suggest trying?

    Tuesday, January 30, 2007 6:16 PM
  • It was just a guess, to be honest. I think your only other alternative is to throw some logging in a script or the service, and see how much of the time is actually spent inside the spawned process. That, or run it in the debugger and profile from there.
    Tuesday, January 30, 2007 6:34 PM