Reg query (IE9 to list of computers)

Hi,

I have this list of 30 pc's to which I would like to query
\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer" /v version | find "version"

Please advise howto.
J.
janhoedtAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
In batch (save as Whatever.cmd and change "test.txt" to the list with your PCs):
@echo off
setlocal
set ComputerFile=test.txt
set LogFile=Results.csv
if exist "%LogFile%" del "%LogFile%"
for /f %%a in ('type "%ComputerFile%"') do (
	for /f "tokens=2*" %%i in ('reg.exe query "\\%%a\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer" /v "version" ^| find /i "Version"') do (
		echo %%a: %%j
		>>"%LogFile%" echo %%a,%%j
	)
)

Open in new window

0
janhoedtAuthor Commented:
Thanks!
Meanwhile did this:
for /f %A in (serverlist.txt) do reg query "\\%A\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer" /v version | find "version"

Works also but some pc's are not reachable, howto built in a timeout of f.e. 1 ping?
0
oBdACommented:
@echo off
setlocal
set ComputerFile=test.txt
set LogFile=Results.csv
if exist "%LogFile%" del "%LogFile%"
for /f %%a in ('type "%ComputerFile%"') do (
	ping -4 -n 2 %%a | find /i "TTL" >NUL
	if errorlevel 1 (
		echo %%a: OFFLINE
		>>"%LogFile%" echo %%a,OFFLINE
	) else (
		for /f "tokens=2*" %%i in ('reg.exe query "\\%%a\HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer" /v "version" ^| find /i "Version"') do (
			echo %%a: %%j
			>>"%LogFile%" echo %%a,%%j
		)
	)
)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.