Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

File batch as Windows Services (sc.exe)

2,037 views
Skip to first unread message

Alessandro

unread,
Nov 27, 2008, 2:50:33 PM11/27/08
to
Hi all,

I have a batch file (actually it starts a java application, it's called
run.bat) and I need to run it as Windows Services.

I've created it using sc.exe tool:

sc create myService binPath= "c:\Dev\Java\run.bat" DisplayName=
myServiceAppl

Successfully created in Services but when I try starting it I get the
following error:

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

Tried also converting run.bat to run.exe but I have the same error and also
tried writing a batch file without starting any java appl (like a simple
ping loop) and I ve the same error !

Any ideas ?

Thanks and best regards,
Alessandro


Ted Davis

unread,
Nov 27, 2008, 8:43:47 PM11/27/08
to
On Thu, 27 Nov 2008 20:50:33 +0100, Alessandro wrote:

> Hi all,
>
> I have a batch file (actually it starts a java application, it's called
> run.bat) and I need to run it as Windows Services.
>
> I've created it using sc.exe tool:
>
> sc create myService binPath= "c:\Dev\Java\run.bat" DisplayName=
> myServiceAppl
>
> Successfully created in Services but when I try starting it I get the
> following error:
>
> Error 1053: The service did not respond to the start or control request in
> a timely fashion

Obviously: SC simply added the command to the services section of the
registry - since the command is not in fact a service type executable, it
doesn't run.

>
> Tried also converting run.bat to run.exe but I have the same error and
> also tried writing a batch file without starting any java appl (like a
> simple ping loop) and I ve the same error !
>
> Any ideas ?

<http://support.microsoft.com/kb/q243486/>

But why does it have to start as a service? Can't it simply be started in
as an item in a startup group?

--

T.E.D. (tda...@mst.edu) MST (Missouri University of Science and Technology)
used to be UMR (University of Missouri - Rolla).

Youri Ligotmi

unread,
Nov 30, 2008, 1:20:47 PM11/30/08
to
Alessandro a écrit :
You can run it as a service using the MS utilities srvany.exe and
instsrv.exe, see at http://www.tacktech.com/display.cfm?ttid=197

HTH

0 new messages