views:

214

answers:

4

A consultant setup a windows service to run a application. The application is supposed to run every 15 mins. The application is not running at all an the service appears to be running fine.

I am not familiar with the how a application will run a a stanard interval when running as a service.

The service uses SRVANY.EXE tool.

A: 

I'm not sure if this is correct, but I believe one way of a serivce running an application is merely to have a thread within OnStart and set it to run the application on an invertal of 15 minutes.

CodeMonkey
+1  A: 

There are many potential issues with your application.

SRVANY.EXE turns any application into a Windows Service. If that application ever asks for user input, it will hang. You will want to confirm that the application running as a service does nothing more than start the other application.

You should also be able to run the "starter" application manually, outside the Windows Service. If it still doesn't work as it should you know it's not related to being run as a service.

Dave Swersky
A: 

To add to the other answers: see KB137890 on what SRVANY.EXE actually does and how to find out what application it is running.

It seems to me that you would be better off (if you can) setting up a scheduled task that runs every the application every 15 minutes if you can.

Andrew Cox
+4  A: 

Any 'consultant' that sets up a service to run using SRVANY.EXE should be fired. SRVANY is an unfortunate hack that should have been retired a decade ago; it should never be used in a production environment.

If the only purpose for the service is to run the app on a schedule then it shouldn't exist at all. Run the app as a Scheduled Task. If it has other functionality then rewrite it as a real service. If it is reasonably well written it should be a fairly easy conversion.

Stephen Martin
+1 for NEVER use SRVANY.EXE...
Dave Swersky