Solved

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

Posted on 2010-09-09
9
434 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
Comment Utility
you want the exe to start on startup?
0
 
LVL 2

Expert Comment

by:Hossy
Comment Utility
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
Comment Utility
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 6

Expert Comment

by:FactorB
Comment Utility
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

Author Comment

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

Expert Comment

by:Hossy
Comment Utility
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
Comment Utility
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
Comment Utility
"How to create a Windows service by using Sc.exe" - http://support.microsoft.com/kb/251192
0
 
LVL 2

Expert Comment

by:Hossy
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now