| @echo off &color 0a &setlocal enabledelayedexpansion |
| pushd "%cd%" |
| |
| set Tm=300 |
| :main |
| |
| set /a "a=b=c=d=e=f=g=h=i=j=0" |
| |
| sures sures >sures.txt |
| if not exist sures.txt (msg %username% /time:5 "错误!!未找到 sures.txt 文件!!!" &call exit) |
| |
| if not exist "agent.txt" (echo.日期 时间 机器名 Agent使用数量/空余数量)>"Agent.txt" |
| for /f "delims=" %%a in ('findstr /i /c:"_12 RES IN USE" "sures.txt" 2^>nul') do (set /a "a+=1") |
| for /f "delims=" %%a in ('findstr /i /c:"_12 RES AVAILABLE" "sures.txt" 2^>nul') do (set /a "b+=1") |
| (@echo.!date! !time! %computername% !a!^/!b!)>>"Agent.txt" |
| |
| if not exist "Telephony.txt" (echo.日期 时间 机器名 电话使用数量/空余数量)>"Telephony.txt" |
| for /f "delims=" %%a in ('findstr /i /c:"_8 RES IN USE" "sures.txt" 2^>nul') do (set /a "c+=1") |
| for /f "delims=" %%a in ('findstr /i /c:"_8 RES AVAILABLE" "sures.txt" 2^>nul') do (set /a "d+=1") |
| (@echo.!date! !time! %computername% !c!^/!d!)>>"Telephony.txt" |
| |
| if not exist "Ntdll.txt" (echo.日期 时间 机器名 动态库使用数量/空余数量)>"Ntdll.txt" |
| for /f "delims=" %%a in ('findstr /i /c:"_15 RES IN USE" "sures.txt" 2^>nul') do (set /a "e+=1") |
| for /f "delims=" %%a in ('findstr /i /c:"_15 RES AVAILABLE" "sures.txt" 2^>nul') do (set /a "f+=1") |
| (@echo.!date! !time! %computername% !e!^/!f!)>>"Ntdll.txt" |
| |
| if not exist "database.txt" (echo.日期 时间 机器名 数据库使用数量/空余数量)>"Database.txt" |
| for /f "delims=" %%a in ('findstr /i /c:"_4 RES IN USE" "sures.txt" 2^>nul') do (set /a "g+=1") |
| for /f "delims=" %%a in ('findstr /i /c:"_4 RES AVAILABLE" "sures.txt" 2^>nul') do (set /a "h+=1") |
| (@echo.!date! !time! %computername% !g!^/!h!)>>"Database.txt" |
| |
| if not exist "SOAP.txt" (echo.日期 时间 机器名 SOAP使用数量/空余数量)>"SOAP.txt" |
| for /f "delims=" %%a in ('findstr /i /c:"_50 RES IN USE" "sures.txt" 2^>nul') do (set /a "i+=1") |
| for /f "delims=" %%a in ('findstr /i /c:"_50 RES AVAILABLE" "sures.txt" 2^>nul') do (set /a "j+=1") |
| (@echo.!date! !time! %computername%! !i!^/!j!)>>"SOAP.txt" |
| ping localhost -n %TM% >nul |
| cls &goto :mainCOPY |