最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

Windows下DOSBAT实现服务的重启

业界 admin 11浏览 0评论

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

发布评论

评论列表 (0)

  1. 暂无评论