mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-18 20:39:14 +08:00
windows: 修复有时重启 rdp 服务时死循环
This commit is contained in:
parent
82b3d7053b
commit
4ed62d849f
@ -47,9 +47,17 @@ rem TermService 运行后,UmRdpService 会自动运行
|
||||
rem 如果刚好系统在启动 rdp 服务,则会失败,因此要用 goto 循环
|
||||
rem The Remote Desktop Services service could not be stopped.
|
||||
|
||||
rem 有的机器会死循环,开机 logo 不断转圈
|
||||
rem 通过 netstat netstat -ano 可以看到端口已修改成功,但rdp服务不断重启 (pid一直改变)
|
||||
rem 因此限定重试次数避免死循环
|
||||
|
||||
set retryCount=5
|
||||
|
||||
:restartRDP
|
||||
if %retryCount% LEQ 0 goto :del
|
||||
net stop TermService /y && net start TermService || (
|
||||
timeout 5
|
||||
set /a retryCount-=1
|
||||
timeout 10
|
||||
goto :restartRDP
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user