Solved

How do I install an .exe as a service into Windows 2008 Server?

Posted on 2010-09-09
9
441 Views
Last Modified: 2012-05-10
This will probably be simple but I just can't figure it out! How do I install an .exe as a service?
Thanks!
0
Comment
Question by:Bianca
9 Comments
 
LVL 16

Expert Comment

by:uescomp
ID: 33638711
you want the exe to start on startup?
0
 
LVL 2

Expert Comment

by:Hossy
ID: 33638738
Generically, you can use instsrv.exe.  Make sure you run the Command Prompt as an Administrator.

Syntax:
Installs and removes system services from NT

INSTSRV <service name> (<exe location> | REMOVE)
  [-a <Account Name>] [-p <Account Password>]

  Install service example:

    INSTSRV MyService C:\MyDir\DiskService.Exe
    -OR-
    INSTSRV MyService C:\mailsrv\mailsrv.exe -a MYDOMAIN\joebob -p foo

  Remove service example:

    INSTSRV MyService REMOVE
0
 
LVL 2

Expert Comment

by:Hossy
ID: 33638748
If you could provide more information on the EXE you're trying to do, that might help my answer better.  Is the EXE a .NET application, already a service, or just some random command-line exe?  What is the reason you want it to run as a service?  What does the EXE do?
0
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
LVL 6

Expert Comment

by:FactorB
ID: 33640381
Or simply hide the main window and instead of program you will have process. Plus you can not do this on form show, you will need a timer that can trigger, for example, after 50 ms. Then insert OnTimer event Form1.Hide; ... well there are more elegant ways to do this, but for this one you don't need administrative privileges.

Regards,
B.
0
 

Author Comment

by:Bianca
ID: 33641626
Oops... I am on Windows 2003 server and the INSTSRV command is not recognized... any other options?
0
 
LVL 2

Expert Comment

by:Hossy
ID: 33642635
On 2003, you have a lot more options...

SC CREATE
INSTSRV (available from the Resource Kit Tools - download here: http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en)

There are multiple third-party programs that install themselves and can wrap around anything -- EXE, VBS, BAT, CMD

Again, can you provide more information about the EXE?

If you could provide more information on the EXE you're trying to do, that might help my answer better.  Is the EXE a .NET application, already a service, or just some random command-line exe?  What is the reason you want it to run as a service?  What does the EXE do?
0
 
LVL 2

Expert Comment

by:Hossy
ID: 33642642
SC CRETAE Syntax:

DESCRIPTION:
        Creates a service entry in the registry and Service Database.
USAGE:
        sc <server> create [service name] [binPath= ] <option1> <option2>...

OPTIONS:
NOTE: The option name includes the equal sign.
      A space is required between the equal sign and the value.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (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 2

Accepted Solution

by:
Hossy earned 500 total points
ID: 33642645
"How to create a Windows service by using Sc.exe" - http://support.microsoft.com/kb/251192
0
 
LVL 2

Expert Comment

by:Hossy
ID: 33642665
Out of all the third-party tools I've used, I recommend FireDaemon over them all (it isn't free, but fairly cheap -- $49).  http://www.firedaemon.com/
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

679 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