Monday, May 15, 2006 12:08 PM
I want to install the windows service using DOS Prompt(not Visual Studio command prompt).
How to do this?
plz help me will be appriciated
Monday, May 15, 2006 12:19 PM
In VStudio command prompt run :- installutil <Path of the Service> (e.g installutil C:\MyService.exe)
Im not sure if normal DOS cmd can do this.
Hope this helps.
- Proposed As Answer by bennett.d Wednesday, April 03, 2013 5:02 PM
Monday, May 15, 2006 12:39 PM
plz read once again my question.
I want to install windowsService from command Prompt.
Not from VisualStudioCommandPrompt.
How to do this?
Monday, May 15, 2006 1:30 PM
Sorry for the confusion, you still need to invoke installutil in order to install your service, there's no other way to do this if you dont have the .Net Framework runnig on your machine. The alturnatives if you are using normal CMD are :-
1. On VS 2003 :- C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe C:\MyService.exe
2 On VS 2005 Express :- C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\MyService.exe
Hope this Helps
Monday, March 17, 2008 7:26 AM
I have tried the above steps, but the problem is that I am having Windows XP and it doesnot recognize InstallUtil via command prompt. Is there any alternative command which I can use instead of InstallUtil.
Thanks & Regards,
Monday, March 17, 2008 9:03 AMHi Amit
You need to have atleast the .Net Framework installed ( i guess your service is .net and hence would need it anycase rt)
After that go to your .Net framework folder under windows directory and run the installUtil application to register the service.
Thanks n Regards
Tuesday, June 03, 2008 9:10 AMHi All,
Check if .NET framework 2.0 is installed. u can find the folder C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 folder. Just use the installutil.exe utility from this folder and install the service.
Tuesday, June 03, 2008 9:22 AMHello Ramana,
I can understand your problem..
InstallUtil is a Visual Studio command and so it wont recognise in the command prompt in Windows XP since a path to it has not been set..
So you have to set a path for this command so that windows may recognise it...
Try these steps:
1. Right Click 'My Computer' in your desktop.
2. goto Properties -> Advanced -> Environment Variables
3. Find the 'Path' variable in system variables and click EDIT.
4. Add this path C:\Program Files\Microsoft Visual Studio 9.0\VC\; to you existing path.
5. Restart cmd and type installutil at command prompt. If it works correctly, some text would scroll up in the command window.
Remember you need to append this path to the existing path variable. This means that if a semicolon is not there at the end of the existing path, dont forget to first type a semi colon ';' and then add the path in step 4.
If .NET is installed in some other drive, give the appropriate path..
Hope this helps !!
Always mark the post that helped you as "Answer". That helps future users to locate answers quickly.
- Proposed As Answer by Somnath Paul Tuesday, June 03, 2008 9:22 AM
Thursday, August 14, 2008 9:56 AMthank you for giving the path, this helpe me very much
Wednesday, July 29, 2009 9:06 AMHi friend,
I have implemented as you said and it works for me very nice.
But friend i want to install windows service for .net framework 3.5 so from where i can run?
I have windows service exe making in .net 3.5. now i want to install this so how can it possible?
Thanks & Regards
Wednesday, July 29, 2009 3:52 PMHi All,
I had used all the above methods to install a windows service using installutil.exe. I tried both in Visual Studio command prompt as well as Windows cmd (by the appropriate ways specifies above).
In VS Command Prompt i am using the command : C:\folder pathname-----\installutil.exe bin\MyService.exe
But, i am continuously getting the same error all the time : Exception occurred while initializing the installation:System.IO.FileNotFoundException:Could not load file or assembly "path of the file----/installutil.exe bin\MyService.exe" or one of its dependencies. The system could not find the file specified..
Though i could see that the MyService.exe file is well created in the bin/Debug folder in my solution folder.
I dont know what is going wrong here...Can anybody please help?
Thanks and regards,
Wednesday, July 29, 2009 4:02 PMIf in the VS command prompt, I type down : "C:\ ---pathname---\ installutil.exe Myservice.exe " , It tries to install the service but fails everytime. It says "The installation failed, and the Rollback has been performed." I dont know how to proceed with this...help needed..!
Thursday, August 06, 2009 3:29 PMyou need to go to the corresponding folder for the version of .net in "C:\WINDOWS\Microsoft.Net\Framework\" in command prompt
I believe for .net 3.5 you need to use "AddInUtil.exe"
And then run that followed by C:\--Path-to-serverice.exe--\service.exe and that should work....
Thursday, August 06, 2009 4:59 PM
Please check this way (http://www.liberidu.com/blog/?p=304).
Scio me nihil scire
Tuesday, August 18, 2009 8:19 PM
I hope you have the .Net Framework 2.0 installed on your machine.
When you are running installUtil.exe from the VS Command prompt please use the full path for your exe file that you have craeted eg.
c:\Program Files\Microsoft Visual Studio 9.0\VC>InstallUtil c:\Application Folder\Bin\Release\FileName.exe
This should work.
Use installUtil /u to unistall the service
Friday, October 09, 2009 2:19 PMSimple. Once upon a time, before .NET this was done manually. Luckilly, Windows still supports this process.
Open a command prompt and execute SC /?.
This is the command line application for managing the NT Service Controller.
Gary in Massena
- Proposed As Answer by GTNovosel Friday, October 09, 2009 2:20 PM
Sunday, April 18, 2010 5:01 PMThere is no difference b/w the VisualStudioCommandPrompt and cmd except the evironment variables and the default working directory.
Friday, June 18, 2010 7:53 PM
Abhi......Need to provide the full path.
Friday, June 18, 2010 7:55 PM
Explanation cannot be any more simpler than suggested by BullDog.
Wednesday, July 28, 2010 12:14 AM
you can find installutil.exe only in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727.
I am unable to find that in other versions. Any way your post is helpful man...thanks.
Saturday, August 21, 2010 12:06 PM
I don't know why guys are complicating life for you... just go to command prompt and use servicename.exe /install
C:\Documents and Settings\igachugu>e:
E:\Timer>Cyberman.exe /install (This installs the windows service Cyberman.exe and gives a confirmation)
E:\Timer>Cyberman.exe /uninstall (This removes the service)
Let me know if it works.
Friday, January 28, 2011 1:12 AM
To install windows service using Command Prompt, you should set the Variable Environment to the path where installutil saved, so the command prompt so the command prompt will recognized the 'Installutil'.
How to set the windows Variable environment you can refer to this link
Sunday, February 27, 2011 7:13 AMBelow link provide a clean and crisp solution for the above problem
Wednesday, April 13, 2011 11:04 AM
Maybe this can help:
It explains how to register a service.
Thursday, October 06, 2011 8:42 AMApologies, though it is silly, if you can't find it why don't you search for it? :) No offence mate.
Wednesday, August 29, 2012 7:22 AM
I think it would be:
C:\folder pathname----bin\debug>installutil MyService.exe
hope it will help you.
Friday, October 05, 2012 6:47 AM
Run your ComandPrompt as "Run As Administrator" and follow these stepsCMD---> Run as Administrator
--->set cmd path to installutil.exe (eg:C:\Windows\Microsoft.NET\Framework\v2.0.50727)
---> type InstallUtil.exe ----"path of your service"---
r.exe) complete path looks as(WindowsServicesTimer.exe is the name of the service)
Friday, October 12, 2012 8:28 PM
"servicename.exe /install" Doesn't work. Windows pops up a dialog telling you to use installutil.exe
- Edited by zhiwong Friday, October 12, 2012 8:29 PM
Saturday, October 13, 2012 3:19 AMIs this your service or one you have from somewhere else? I always build a custom Installer class into my services so that you can install them via the command line (-i to install, -u to uninstall). You basically need to create your own class derived from Installer and add a properly initialized ServiceProcessInstaller and a ServiceInstaller to the list of Installers.
Wednesday, October 24, 2012 10:42 PM
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Use
rs\Administrator\slpusher.exe' or one of its dependencies. The system cannot fin
d the file specified..
I got this error and I dont have any ideas about how to solve it..anyone can help me?
Thursday, October 25, 2012 3:50 AMYou need to run it in the same folder as "where you placed your EXE files".
Thursday, October 25, 2012 3:51 AM
You need to code the EXE so that it supports that kind of installation.
There aren't free lunch there...
Sunday, December 09, 2012 5:39 PM
From Command Prompt:
sc create "Service Name" binpath= "FULL PATH TO EXECUTABLE" start= auto
The spaces after the equal signs are required most of the time. Include them.
Wednesday, December 12, 2012 6:25 PM
This is for future reference.
Please follow steps in following link to build .exe file. Then follow further steps to install the windows service
After building .exe file for the Windows Service, the .exe file resides inside the Debug folder of the service. (eg - C:\ProjectName\ProjectNameService\bin\Debug).
Start>>search for Command prompt in the search bar. Right click on "Visual Studio Command Prompt (2010)", select "Run As Administrator". NOTE: Please make sure that you have selected a Visual Studio Command Prompt and not the general DOS prompt. It is because the "installutil" command that we will be using next will not run in the general DOS prompt. It will display an error message.
cd\ to go to C:\>
This will install the windows service.