Update Veeam-Services-Control.cmd

This commit is contained in:
2024-12-14 14:06:05 -06:00
parent 4a1943bb0b
commit bb58abce6d

View File

@@ -21,10 +21,9 @@ if "%errorlevel%"=="3" (
set start=true
)
postgresql-x64-15
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 "postgresql-x64-15"^|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 "postgresql-x64-15"^|find /i /v "veeam.archiver"') do net start /y "%%?"
for /f "tokens=2" %%? in ('sc query type^= service state^= all^|find /i "veeam"^|find /i /v "sqlagent"^|find /i "postgresql-x64-15"') do net %switch% /y "%%?"
if "%switch%"=="stop" for /f "tokens=3*" %%? in ('tasklist /fo list^|find /i "veeam"') do taskkill /f /im "%%?"
if "%start%"=="true" for /f "tokens=2" %%? in ('sc query type^= service state^= all^|find /i "veeam"^|find /i /v "sqlagent"^|find /i "postgresql-x64-15"') do net start /y "%%?"
echo ""
#pause