@echo off
MD %SystemDrive%\INVENTORY\%COMPUTERNAME% > NULL 2>&1
For /f "Skip=1 Tokens=*" %%a in ('@ping -n 1 %computername%') do set line=%%a&call :ipa
endlocal&set $ip1=%$ip1%&set $ip2=%$ip2%&set $ip3=%$ip3%&set $ip4=%$ip4%
goto :EOF
:ipa
if /i not "%line:~0,7%"=="Pinging" goto :EOF
for /f "Tokens=2 Delims=[]" %%b in ('@echo %line%') do set ip=%%b
for /f "Tokens=1-4 Delims=." %%a in ('@echo %ip%') do set $ip1=%%a&set $ip2=%%b&set $ip3=%%c&set $ip4=%%d
set myip=%$ip1%.%$ip2%.%$ip3%.%$ip4%
echo Checking Local System with IP: %myip%
@ECHO.
@Echo Please wait....
@Echo.
SET RCOMP=%myip%
SET STOREPATH=%SystemDrive%\INVENTORY\%COMPUTERNAME%
SET UP_FROM_SRV=
SET Program_Version=
SET Engine_Version=
SET PatternDate=
SET Damage_Cleanup_Engine=
@echo ^ > %STOREPATH%\%RCOMP%_TrendMicroInfo.xml
@echo ^^ >> %STOREPATH%\%RCOMP%_TrendMicroInfo.xmlen^ >> %STOREPATH%\%RCOMP%_TrendMicroInfo.xml
@echo ^%RCOMP%^ >> %STOREPATH%\%RCOMP%_TrendMicroInfo.xml
For /F "Tokens=3 Delims= " %%a in ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion" /v Server | FIND /I "REG_SZ""') Do SET UP_FROM_SRV=%%a
For /F "Tokens=3 Delims= " %%a in ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc." /v ProgramVer | FIND /I "REG_SZ""') Do SET Program_Version=%%a
For /F "Tokens=3 Delims= " %%a in ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc." /v EngineZipVer | FIND /I "REG_SZ""') Do SET Engine_Version=%%a
For /F "Tokens=3 Delims= " %%a in ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc." /v PatternDate | FIND /I "REG_SZ""') Do SET PatternDate=%%a
For /F "Tokens=3 Delims= " %%a in ('"REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Misc." /v TSC-Ver | FIND /I "REG_SZ""') Do SET Damage_Cleanup_Engine=%%a
REM .......... TrendMicro ..........
@echo ^^ >> %STOREPATH%\%RCOMP%_TrendMicroInfo.xmlTrendMicro^ >> %STOREPATH%\%RCOMP%_TrendMicroInfo.xml
@echo ^- ^
>> %STOREPATH%\%RCOMP%_TrendMicroInfo.xml%UP_FROM_SRV%^ ^%Program_Version%^ ^%Engine_Version%^ ^%PatternDate%^ ^%Damage_Cleanup_Engine%^ ^
@echo ^
REM .......... TrendMicro ..........
@echo ^
Now, when you execute TrendMicroInfo.bat, on a system drive (generally it's drive "C") will be created folder INVENTORY. Inside this folder you will find a folder according to the Computer Name and inside this folder should be a file, named accordingly to the "IP_Address"_TrendMicroinfo.xml
If you enjoyed this post consider subscribing via or Email
No comments:
Post a Comment