I have a file "init.cmd" which has the following commands inside it:

set APP_ROOT=c:/wamp/www/myproj
ringo -b %APP_ROOT%/bin/init.js %APP_ROOT%/app/main.js

The file works fine when run from the command line, but I'd like to turn it into a Windows Service.

So I type:

sc create MyServiceName binPath= c:/wamp/www/myproj/bin/init.cmd

The service is created, but everytime I try to start it, it crashes saying:

Error 1053: The service did not respond to the start or control request in a timely fashion.

I have a similar problem w/ Mongo, which is much simpler.

From a command prompt typing:


successfully starts the mongo server.

But trying to install a service as :

sc create mongo binPath= c:\mongodb\bin\mongod.exe

crashes on start everytime with the same error as above.

  • Do you really need it to be a services, or do you just need it to start when the computer starts? You may be better off setting up a schedule task that is ran when the computer starts. – Zoredache Sep 21 '10 at 0:42

You can't create a service pointing at a batch file. Create the service pointing to the ringo app, then edit the registry and give it the needed parameters. Set a system wide variable to the value that you need. That should allow the service to start.

  • I have the same problem with Mongo which isn't a batch file. – Scott Klarenbach Sep 21 '10 at 0:29
  • It may just be poor error reporting for different reasons. – Scott Klarenbach Sep 21 '10 at 0:29
  • Let's forget Mongo for the moment. Am I able to have the service spawn a batch file AFTER it's been started? The trouble is that I have to set a variable in the LOCAL scope of the app so a system wide variable will conflict with other apps - hence the batch file. – Scott Klarenbach Sep 21 '10 at 0:37
  • No, the service won't be able to run a batch file. What you could do is throw together a small .NET app and have it set the local variable then launch the app. Can you run the app under a local user account? How about setting up an account and setting up a user variable with the correct setting. That way it won't impact other apps on the system unless they are run under that specific local account. – mrdenny Sep 21 '10 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.