Tuesday, August 5, 2014

Installing a Service

I learned how to install a service yesterday from the command line.
  1. Pull up a command window
    • Start bar, type cmd and click cmd.exe.
  2. Change directory to the correct Microsoft.net framework: For me the directory was at:
    • cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
  3. Execute installutil
    • C:\Windows\Microsoft.NET\Framework\v4.0.30319>installutil C:\(location of the service)\Myservice\Bin\Myservice.exe
  4. Start the service
    • Open the Window Services list
      1. Open a run box.
      2. Type services.msc and press return.
    • Right Click the service and select Start.


When making changes to the Service, make sure to uninstall the service before re-installing it.
  1. Stop the service
    • Open the Window Services list
      1. Open a run box. 
      2. Type services.msc and press return.
    • Right Click the service and select Stop.
  2. Close the Window Services list
  3. Pull up a command window
    • Start bar, type cmd and click cmd.exe.
  4. Change directory to the correct Microsoft.net framework: For me the directory was at:
    • cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
  5. Execute installutil with /U Parameter
    • C:\Windows\Microsoft.NET\Framework\v4.0.30319>installutil /U C:\(location of the service)\Myservice\Bin\Myservice.exe

Thanks to Jayesh Jain for the great article on Creating a Windows Service in VB.NET 


No comments:

Post a Comment