Skip to content
nishi_74322014 edited this page Aug 3, 2026 · 1 revision

SCM

概要

サービスコントロールマネージャ
SCM:Service Control Manager

  • 起動時にWindowsサービス(MS_WindowsService.md)を開始、
  • シャットダウン時にWindowsサービスを停止、

などを行う。

※ 実体は services.exe。個々のサービスは svchost.exe(共有ホスト)または
専用の実行ファイルとしてホストされる。

操作

  • GUI
    • [管理ツール] → [サービス]
    • [ファイル名を指定して実行] → services.msc
  • CUI
    • sc.exe query / sc start / sc stopsc 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.WindowsServicesUseWindowsService() を使うのが現在の標準 (同じホストを Linux では systemd サービスとして動かせる)。

参考


Tags: Windows, プログラミング

NetDevInfraWiki

マイクロソフト系技術情報 Wiki
Open 棟梁 Wiki

(未着手)

開発基盤部会 Wiki

移行管理: DONETODO

Clone this wiki locally