使用管理员权限启动powershell
安装服务
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"
使用管理员权限启动powershell
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"