update
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
@echo off
|
||||
|
||||
fsutil dirty query "%SystemDrive%">nul 2>&1 || "%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "Start-Process '%~f0' -Verb RunAs" 2>nul && goto :eof || goto :eof
|
||||
|
||||
:menu
|
||||
set switch=
|
||||
set start=
|
||||
@@ -7,6 +9,7 @@ cls
|
||||
echo 1) Start
|
||||
echo 2) Stop
|
||||
echo 3) Restart
|
||||
|
||||
choice /c:123 /n /m "Choose: "
|
||||
if "%errorlevel%"=="1" set switch=start
|
||||
if "%errorlevel%"=="2" set switch=stop
|
||||
@@ -14,9 +17,13 @@ if "%errorlevel%"=="3" (
|
||||
set switch=stop
|
||||
set start=true
|
||||
)
|
||||
for /f "tokens=2" %%? in ('sc query type^= service state^= all^|find /i "veeam"^|find /i "service_name"^|find /i /v "sqlagent"^|find /i /v "veeam.archiver"') do net %switch% "%%?"
|
||||
|
||||
for /f "tokens=2" %%? in ('sc query type^= service state^= all^|find /i "veeam"^|find /i "service_name"^|find /i /v "sqlagent"^|find /i /v "veeam.archiver"') do net %switch% /y "%%?"
|
||||
if "%switch%"=="stop" for /f "tokens=3*" %%? in ('tasklist /fo list^|find /i "veeam"^|find /i /v "veeam.archiver"') do taskkill /f /im "%%?"
|
||||
if "%start%"=="true" for /f "tokens=2" %%? in ('sc query type^= service state^= all^|find /i "veeam"^|find /i "service_name"^|find /i /v "sqlagent"^|find /i /v "veeam.archiver"') do net start "%%?"
|
||||
if "%start%"=="true" for /f "tokens=2" %%? in ('sc query type^= service state^= all^|find /i "veeam"^|find /i "service_name"^|find /i /v "sqlagent"^|find /i /v "veeam.archiver"') do net start /y "%%?"
|
||||
|
||||
echo ""
|
||||
pause
|
||||
#goto menus
|
||||
#pause
|
||||
#goto menus
|
||||
|
||||
:eof
|
||||
|
||||
Reference in New Issue
Block a user