如何将exe程序注册为Windows服务,实现后台长期运行?

2026-04-16 14:412阅读0评论SEO教程
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计687个文字,预计阅读时间需要3分钟。

如何将exe程序注册为Windows服务,实现后台长期运行?

如何将exe注册为Windows服务,直接从后台运行?

如何将exe程序注册为Windows服务,实现后台长期运行?

方法一:使用Windows自带的命令sc

使用sc create命令创建服务。

例如:sc create CaptureScreen binpath=F:\zwmei-project\decklink-learning\OutputBitmap\Debug\OutputBitmap.exe

如何将exe注册为windows服务,直接从后台运行

方法一:使用windows自带的命令sc 使用sc create 方法创建。 如:sc create CaptureScreen binpath= F:\zwmei-project\decklink-learning\OutputBitmap\Debug\OutputBitmap.exe type= own start= auto displayname= Screen_Capture 其中 CaptureScreen为服务名,可以在系统服务中找到,(通过在命令行运行services.msc打开系统服务)。binpath为你的应用程序所在的路径。 displayname为服务显示的名称,这个在注册表中可以找到,(通过在命令行中输入regedit打开注册表,在HKEY_LOCAL_MACHINE -- SYSTEM -- CurrentControlSet 下找到你的服务显示名) 注意:在sc命令中,=号前面不能有空格,而=号后面必须有一个空格,切记。

阅读全文

本文共计687个文字,预计阅读时间需要3分钟。

如何将exe程序注册为Windows服务,实现后台长期运行?

如何将exe注册为Windows服务,直接从后台运行?

如何将exe程序注册为Windows服务,实现后台长期运行?

方法一:使用Windows自带的命令sc

使用sc create命令创建服务。

例如:sc create CaptureScreen binpath=F:\zwmei-project\decklink-learning\OutputBitmap\Debug\OutputBitmap.exe

如何将exe注册为windows服务,直接从后台运行

方法一:使用windows自带的命令sc 使用sc create 方法创建。 如:sc create CaptureScreen binpath= F:\zwmei-project\decklink-learning\OutputBitmap\Debug\OutputBitmap.exe type= own start= auto displayname= Screen_Capture 其中 CaptureScreen为服务名,可以在系统服务中找到,(通过在命令行运行services.msc打开系统服务)。binpath为你的应用程序所在的路径。 displayname为服务显示的名称,这个在注册表中可以找到,(通过在命令行中输入regedit打开注册表,在HKEY_LOCAL_MACHINE -- SYSTEM -- CurrentControlSet 下找到你的服务显示名) 注意:在sc命令中,=号前面不能有空格,而=号后面必须有一个空格,切记。

阅读全文