Solved

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

Posted on 2010-09-09
9
439 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

OfficeMate Freezes on login or does not load after login credentials are input.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
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 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 …

827 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