# 新建服务

1.命令行创建

```
sc create qwqdanchun binpath= "cmd.exe /k C:\Temp\qwqdanchun.exe" start="auto" obj="LocalSystem"

sc start qwqdanchun
```

2.Powershell

```
New-Service -Name "qwqdanchun" -BinaryPathName "C:\Temp\qwqdanchun.exe" -Description "Service by qwqdanchun" -StartupType Automatic

sc start qwqdanchun
```
