כיצד להציג את כתובות כל המחשבים המחוברים לרשת הפנימית
1. יש לשמור את הקוד המופיע למטה בקובץ show-ip.bat
2. יש להפעיל את דוס (תפריט התחל > הפעלה > CMD) ולהריץ את הקובץ הזה.
1. יש לשמור את הקוד המופיע למטה בקובץ show-ip.bat
2. יש להפעיל את דוס (תפריט התחל > הפעלה > CMD) ולהריץ את הקובץ הזה.
@echo off
echo Snir Show Ip Address
echo ---
echo This file shows a list of all computers that are
echo connected to the local network,
echo the same like 'net view' does,
echo but this shows thier IP Address as well
echo .
echo -------------- Press any key to continue... --------------
pause > nul
setlocal EnableDelayedExpansion
set "xNext="
set "xComputer="
for /f %%A in ('net view /all') do (
set "xComputer=%%~A"
if "!xComputer:~0,2!"=="\\" for /f "tokens=2,* delims=. " %%X in ('nslookup %%A') do (
if "!xNext!"=="1" (
echo.!xComputer! = %%X.%%Y
set "xNext=0"
)
if "!xComputer:~2!"=="%%~X" set "xNext=1"
)
)
endlocal
pause