admin 管理员组

文章数量: 887018

Windows下DOS/BAT实现服务的重启

  • Script
  • 参考

Script


@echo off

sc query SessionEnv | findstr "RUNNING"

if %errorlevel% equ 0 (
echo "==> State code : %errorlevel%"
echo "==> RDP Service is already running ..."

) else (
echo "==> State code : %errorlevel%"
net  start  SessionEnv
echo "==> Starting RDP Service ...."
)
echo byebye 
TIMEOUT /T 10
exit 


:: Refer_link https://www.jb51/article/14986.htm

参考

https://www.jb51/article/14986.htm

本文标签: 重启 Windows DOS bat