Installing a Windows Service with Powershell

by ebarcza 3/31/2020 11:27:00 AM

Install your service manually using PowerShell

  1. From the Start menu, select the Windows PowerShell directory, then select Windows PowerShell.

  2. Access the directory where your project's compiled executable file is located.

  3. Run the New-Service cmdlet with the with your project's output and a service name as parameters:

New-Service -Name "YourServiceName" -BinaryPathName <yourproject>.exe

 

Uninstall your service manually using PowerShell

  1. From the Start menu, select the Windows PowerShell directory, then select Windows PowerShell.

  2. Run the Remove-Service cmdlet with the name of your service as parameter:

Remove-Service -Name "YourServiceName"

sc.exe delete "YourServiceName" for PSVersion 5.1

Tags: ,

Powershell

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  November 2020  >>
MoTuWeThFrSaSu
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2020

Sign in