PING ADDRESS FROM REG QUERY Not Working...
Posted: 20 Jun 2012 15:15
Hey Guys,
I got the following code below giving me my current Proxy address from the
registry but when I try to add in Ping its gives error and not working.. I think I am close but
if one of you Guru's can help I would really appreciate it..
I got the following code below giving me my current Proxy address from the
registry but when I try to add in Ping its gives error and not working.. I think I am close but
if one of you Guru's can help I would really appreciate it..
Code: Select all
@echo off
for /F "eol= tokens=1* " %%a in ('REG Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v proxyserver /t REG_SZ 2^>nul ^| find "REG_SZ"') do set str=%%b
set str=%str:~10,20%
if '%str%'=='' (
ping -n 12 %str%
)
:Output
ping -n 12 %str%
echo Your Current Proxy Address Is: %str%
pause