Batch files ip address

December 8, 2009 at 12:55:06
Specs: Windows Vista
looking to make a batch file that shows my ip
address, gateway, dhcp, and subnet mask. In
this format

Your ip addres is:XXX.XXX.XXX.XXX
your gateway is :XXX.XXX.XXX.XXX
ect
only thing is i cannot use the piping option at
all, anyone know how i would go about doing
that.


See More: Batch files ip address

Report •


#1
December 9, 2009 at 01:02:22
"only thing is i cannot use the piping option at
all"

why?


=====================================
Helping others achieve escape felicity

M2


Report •

#2
December 9, 2009 at 23:01:58
yeah, like M2 said... why? give us a little background, you want us a' work a'for not'ing? we're curious as befits our field of endeavor... we don ask much...
anyway... this *might* do what you want. it DOES create an executable on your system (a .com file), and if, (just for example), a person was trying to evade system scrutiny, I doubt if this would accomplish it unless security is mickey-mouse level.

goto :skipov
f100,1ff,0
a100
PUSH DS
MOV AX,B700
MOV DS,AX
MOV SI,1000
MOV DI,SI
MOV CX,0050
LODSB
CS:
STOSB
INC SI
LOOP 010E
MOV AX,0A0D
STOSW
CMP SI,C000
JB 010B
POP DS
MOV AX,6C00
MOV DX,0012
MOV SI,0180
MOV BX,0002
XOR CX,CX
INT 21
MOV BX,AX
MOV AH,40
MOV DX,1000
MOV CX,0FB2
INT 21
MOV AH,3E
INT 21
INT 20

f180,189,"SCREEN.CAP"
RCX
100
NSCAP.COM
W
Q
:skipov
:: the above just writes a simple screen-capture executable
:: called SCAP.COM and it writes to a file SCREEN.CAP
:: as usual, remove all the ECHO and PAUSE debugging/
:: testing, but i left them active so you could analyze output.
@echo off && setlocal enabledelayedexpansion
if exist scap.com goto alrdone
debug < scc.bat
:alrdone
cls
ipconfig
scap
for /f "tokens=* delims=" %%a in (screen.cap) do (
set bb=%%a
set cc=!bb:~8!
call :rtrim

if "!cc!" neq "" (
echo data: [!cc!]
set ku=!cc:~0,11!
if /i "!ku!" equ "ip address." (
echo ********** IP !cc!
set /a mm+=1
set I1!mm!=!cc:~36,15!)
if /i "!ku!" equ "subnet mask" (
echo ********** SUBNET !ku!
set I2!mm!=!cc:~36,15!)))
:goto :hevn


for /L %%b in (1 1 !mm!) do (
echo %%b ip address[!I1%%b!]
echo %%b subnet mask[!I2%%b!]
echo. )
goto :ex

:rtrim
if !cc! equ "" goto :ex
if not defined cc goto :ex
set xx=!cc:~-1!
if "!xx!" equ " " (
set cc=!cc:~0,-1!
goto :rtrim
) else (
goto :ex)

goto :ex

:ex
goto :hell

:hell
echo ABANDON HOPE ALL YE WHO ENTER HERE


Report •

Related Solutions


Ask Question