-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSpacedesk服务管理器.bat
48 lines (41 loc) · 1.06 KB
/
Spacedesk服务管理器.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
@echo off
chcp 65001 > nul
title spacedesk服务管理器(Copyright©2021 Cherry_ChenNan)
%1 %2
ver|find "5.">nul&&goto :Admin
mshta vbscript:createobject("shell.application").shellexecute("%~s0","goto :Admin","","runas",1)(window.close)&goto :eof
:Admin
echo.
echo 正在检查Spacedesk服务运行状态...
echo.
set status=1
(tasklist|find /i "spacedeskService.exe" || set status=0 ) 2>nul 1>nul
if %status% == 1 (goto Running) else (goto Stopped)
:Running
set command=
echo spacedesk服务正在运行.
echo.
set /p command=是否要停止服务(y/n):
echo.
if /i %command% == y (
echo 正在停止spacedesk服务...
net stop spacedeskService > nul
echo Spacedesk服务已停止运行.)
goto End
:Stopped
set command=
echo spacedesk服务未在运行.
echo.
set /p command=是否要启动服务?(y/n):
echo.
if /i %command% == y (
echo 正在启动spacedesk服务...
net start spacedeskService > nul
echo spacedesk服务已启动运行.)
goto End
:End
echo.
echo 感谢您使用此脚本.
echo.
echo 请按任意键退出...
pause > nul