Menu ▼


Installing windows service using installutil.exe in visual studio command prompt

To install windows service using installutil.exe in visual studio command prompt follow the below steps

To install service:
  • Open visual studio command prompt as run as administrator
  • Type cd %systemroot%\Microsoft.NET\Framework\v4.0.30319\    -> and click enter
    Note: you may need to change the framework version based on VS you have
  • Type installutil SERVICE PATH
  • Example:
    installutil F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe
To un install service:
  • Open visual studio command prompt as run as administrator
  • Type cd %systemroot%\Microsoft.NET\Framework\v4.0.30319\    -> and click enter
    Note: you may need to change the framework version based on VS you have
  • Type installutil -u SERVICE PATH
  • Example:
    installutil -u F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe

Note:
Instead of opening visual studio command prompt every time and typing all these commands, you can create separate windows command prompt cmd files and open them as run as administrator

Example :
To Install -> install.cmd file:
%systemroot%\Microsoft.NET\Framework\v4.0.30319\installutil F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe
pause

Example :
To Un Install -> uninstall.cmd file:
%systemroot%\Microsoft.NET\Framework\v4.0.30319\installutil -u F:\Delete\SampleSolution\Sample\WindowsServiceExample\bin\Debug\WindowsServiceExample.exe
pause






comments powered by Disqus


Search dotnetlearners.com