Solved

Run as a service

Posted on 2009-07-13
6
368 Views
Last Modified: 2013-12-17
I have a program that only starts when you login to the server.
How can I get a program to run as a service if it is not an option for that program?

Anyway to start the program when the server boots up with out login to the server to start it?

Thanks
0
Comment
Question by:acomisp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 85

Accepted Solution

by:
oBdA earned 500 total points
ID: 24839097
You can do that with srvany from the Resource Kit Tools, which is a service wrapper for other programs.
Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
How To Create a User-Defined Service
http://support.microsoft.com/kb/137890

Another option would be to do that with a scheduled task that is scheduled to run at startup (only visible once the task is created), but the srvany makes it easier to manage.
0
 

Author Comment

by:acomisp
ID: 24839307
does this apply to a windows 2003 server?
the artical goes up to server 2000.
0
 
LVL 85

Expert Comment

by:oBdA
ID: 24839363
Yes, srvany hasn't changed inbetween.
You'll find more documentation in the Resource Kit Help that is installed with the ResKit.
Note that you don't need to install the complete Resource Kit on the server (though I install it by default on every server, lots of useful tools), only srvany.exe and instsrv.exe are required. You can copy those from a machine on which the ResKit is installed.
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 23

Expert Comment

by:Mohamed Osama
ID: 24839476
SC.exe (service controller) can do it
CMD help output for SC Create command 
sc create /?
Creates a service entry in the registry and Service Database.
SYNTAX:
sc create [service name] [binPath= ] <option1> <option2>...
CREATE OPTIONS:
NOTE: The option name includes the equal sign.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>


0
 
LVL 85

Expert Comment

by:oBdA
ID: 24839513
Admin3k,
"sc /create" will only create an entry in the SCM database, nothing more. You can only use it for programs that have been programmed to function as a service, you can NOT use it to run a normal program as a service.
0
 
LVL 6

Expert Comment

by:ChristianWimmer
ID: 24840455
I prefer to use RunAsSys
http://blog.delphi-jedi.net/2008/05/08/runassys-10-preview

Despite its status, it is very useful and works fine, even on server and/or 64bit systems (up to Vista/2008).
It runs applications as the system user. I use it for Visual Studio and some other developer IDEs to test services without the service manager. (http://blog.delphi-jedi.net/2008/05/07/debugging-services-an-easy-way)

(Code is available for Delphi)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question