Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need 'lynx -dump' for DOS batch script

Status
Not open for further replies.

TimeTraveler

IS-IT--Management
Nov 20, 2001
99
US
For any DOS-jocks out there, how does one dump a html page (or any URL, really) from DOS? I'm using blat to send me the router IP, and need to get at the router IP, not the box's IP, and the only way I can think to do it is to pull a web page that'll show it. 'ipconfig /All' doesn't produce the result I'm seeking. It displays the box's IP, not the router.

I'm having problems locating 'doslynx' or similar, and really don't want to have to depend on installing such on the target box. There should be some way to get a netgear router to display it's IP from a DOS prompt (in XP Home).

Thanks in advance.

Sean/TimeTraveler
 
This will give your default gateway (usually the router?)

Line1=@ECHO OFF
Line2=FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG ^| FIND "Default Gateway"') DO FOR %%B IN (%%A) DO SET GWADDR=%%B
Line3=ECHO %GWADDR%

 
Regarding:

Code:
@ECHO OFF
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG ^| FIND "Default Gateway"') DO FOR %%B IN (%%A) DO SET GWADDR=%%B
ECHO %GWADDR%

That's a good start and clever DOS code.

It gives me 192.168.0.1, which is correct for the default gateway. What I need is the external IP to which this default gateway is attached, probably resembling 69.37.x.x. (DSL/Cable dynamically assigned IP on residential service.)

I would like to solve this for my XP Home unit, as well as some family members' PCs in order to (reliably) do KVMoIP. The router DDNS and DDNS service seem to be failing to connect me to the needed machines.

Thanks again for replying to my post. I appreciate the
 
If you use an external DNS server, and it is the first in the listed DNS servers then you could try this...

LINE1=@ECHO OFF
LINE2=FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "DNS Servers"') DO FOR %%B IN (%%A) DO SET DNSADDR=%%B
LINE3=FOR /F "TOKENS=8* DELIMS= " %%A IN ('TRACERT %DNSADDR% ^| FIND " 2 "') DO FOR %%B IN (%%A) DO SET ROUTERADDR=%%B
LINE4=ECHO %ROUTERADDR%

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top