Tom,

You need to write a batch file (*.bat) file that will be executed when your
server boots up.  Back in the old DOS days, that was the only way an
application could be "automatically started up".  Basically, your batch file
will do what you currently do to start your Java application, it will run
the command "java MyApplication".

It's been years since I have written a batch file, but you should be able to
do a web search and find some old examples.  Or, if you have someone older
in your development shop who has some old DOS or C/Pascal programming books
from the mid 80's to the early 90's, you can find examples in those books.
Anything that predates Windows 3.1 will cover batch files.

Celeste

-----Original Message-----
From: Tom Yang [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 12:24 PM
To: [EMAIL PROTECTED]
Subject: How to install a service on a NT server?


Hi all:
  I have a Java application named MyApplication. I need to run it on a NT
server. I can type the command:

java MyApplication

But I want to install it as a service so that the application will be
started automatically each time the machine is booted up and the application
can survive logging off. Putting that short-cut of the command in the
StartUp menu is not what I want because the application window still shows
up in the task bar and will be killed if the current user logs off.
Installing it as a service will meet all my requirements. But I don't know
how to do that. Can anybody please help? I've tried the following methods
but didn't succeed:

1) I found a utility called SRVANY.EXE which, according to the instruction,
will launch the application as a service. But after I have copied the
SRVANY.EXE to my NT box, I can't run it because I got an "Internal error"
message when I run it.

2) I used the INSTSRV utility to install a command file (a batch file
containing the command "java MyApplication") to start my java application.
It seems the batch file can't be used. I probably should have used a .exe
file. But I don't have a utility to convert my batch file to an .exe file. I
found one utility named batch2exe, but that only converts the batch file to
a .com file and that .com file doesn't work on the NT (it only works on
Window 98). Besides, I don't even know whether the .exe file will solve the
problem.

I've asked several people around but to my disappointment, there's no such
expertise here. I've run out of resource. I know this question may be off
the topic to this news group, but I really don't know where else to seek for
help. Hopefully, someone who has the expertise can drop me a line and help
me. Thank you all very much in advance!

Tom



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to