Link to home
Start Free TrialLog in
Avatar of Norm-al
Norm-alFlag for United States of America

asked on

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

This will probably be simple but I just can't figure it out! How do I install an .exe as a service?
Thanks!
Avatar of uescomp
uescomp
Flag of Afghanistan image

you want the exe to start on startup?
Avatar of Hossy
Hossy

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
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?
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.
Avatar of Norm-al

ASKER

Oops... I am on Windows 2003 server and the INSTSRV command is not recognized... any other options?
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?
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>
ASKER CERTIFIED SOLUTION
Avatar of Hossy
Hossy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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/