-
Notifications
You must be signed in to change notification settings - Fork 0
MS_SCM
nishi_74322014 edited this page Aug 3, 2026
·
1 revision
-
TOP > インフラストラクチャ > Windows OSの基礎的トピック
- SCM
サービスコントロールマネージャ
SCM:Service Control Manager
- 起動時にWindowsサービス(
MS_WindowsService.md)を開始、 - シャットダウン時にWindowsサービスを停止、
などを行う。
※ 実体は services.exe。個々のサービスは svchost.exe(共有ホスト)または
専用の実行ファイルとしてホストされる。
- GUI
- [管理ツール] → [サービス]
- [ファイル名を指定して実行] →
services.msc
- CUI
-
sc.exe query/sc start/sc stop(sc configで起動種別の変更) - PowerShell:
Get-Service/Start-Service/Stop-Service/Set-Service
-
- API
-
System.ServiceProcess.ServiceControllerクラスを使用する。
-
補足(最新化):
System.ServiceProcess.ServiceControllerは .NET Core 以降では NuGet パッケージ(System.ServiceProcess.ServiceController)として提供され、 Windows 専用。 .NET でサービスを実装する場合は、Microsoft.Extensions.Hosting.WindowsServicesのUseWindowsService()を使うのが現在の標準 (同じホストを Linux では systemd サービスとして動かせる)。
Tags: Windows, プログラミング
このWikiは「Open棟梁Project」,「OSSコンソーシアム 開発基盤部会」によって運営されています。