使用管理员权限启动cmd.exe
sc.exe create ".NET Joke Service" binpath="C:\Path\To\App.WindowsService.exe" 如果需要更改根目录,可以把目录作为命令行参数送入: sc.exe create "Svc Name" binpath="C:\Path\To\App.exe --contentRoot C:\Other\Path"
sc.exe create ".NET Joke Service" binpath="C:\Path\To\App.WindowsService.exe"
sc.exe create "Svc Name" binpath="C:\Path\To\App.exe --contentRoot C:\Other\Path"
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3