Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
The batch file also writes the date and time to the results file but this can be edited out if you don't want it to. Please let us know if this works and how you want data written to the results file for a final edit.
@echo off
set ServerNames=servers.txt
set ResultsFile=results.txt
set RegPath=HKEY_LOCAL_MACHINE
set RegKey=EnableConsoleTracin
(if not exist %ServerNames% (
echo %date% %time% %~nx0: Cannot find server list: %ServerNames%
exit /b 1
))>>%ResultsFile%
(for /f "tokens=*" %%a in (%ServerNames%) do (
echo.
echo %%a
for /f "skip=4 tokens=1,2*" %%b in ('reg query "\\%%a\%RegPath%" /v %RegKey%') do (
echo.
echo %date% %time% %%a %%d
)
))>>%ResultsFile% 2>&1
exit /b 0