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实现服务的重启
- 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