Norm-al
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!
Thanks!
you want the exe to start on startup?
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
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.
Regards,
B.
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 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|r ec>
(default = own)
start= <boot|system|auto|demand|d isabled|de layed-auto >
(default = demand)
error= <normal|severe|critical|ig nore>
(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>
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
(default = own)
start= <boot|system|auto|demand|d
(default = demand)
error= <normal|severe|critical|ig
(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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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/