• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

Display Machine Name & Ip Address

Dear Sir,

I need how many computer(name or Ip addr) on-line in the same network. suppose machine shutdown or disconnect from network no need to display(Should).

Pls...Pls...Pls.  V.V. V. V.V. Urgent


Best Regards,

M. Rafeek
0
md_yasheen
Asked:
md_yasheen
1 Solution
 
mugman21Commented:
I see no way to do this other than pinging each machine at a set interval.

Mugman
0
 
PorT_Ph0b0sCommented:
I want a program to do that?
I don't know if this help... But if you go to MSDos Console (--> "Start" --> "Run" --> "cmd" - Ok) On WIndows XP, and if you type "net view", you can see the computers on your network. If they disconect, ou shutdown, they aren't listed.

Ph0b0s
0
 
DrWarezzCommented:
NET VIEW  is probably your best bet, and is available on all Win NT machines (and a few more I believe)..
However, if you already have a LIST of all machines on the network, like the following (for example):

MachineName1
MachineName2
...

Then you can check each one to find out whether or not they're connected (ie; not shutdown/disconnected), like so:

:-------8<-------------------------------- FileName.bat ---------------------------------------------:
@ECHO OFF
PUSHD %CD%
TITLE Machine Verifier
SET OnlineFile=OnlineMachines.txt
ECHO Machines Online: >> %OnlineFile% & ECHO. >> %OnlineFile%

ECHO.
:GET_FILE
SET /P File="File containing Machine Names: "

IF /I [%File%]==[] (
    ECHO.
    ECHO You must input a file name.
    ECHO.
    GOTO :GET_FILE
)

IF NOT EXIST "%FILE%" (
    ECHO.
    ECHO The specified file: %File% could not be located.
    ECHO.
    SET File=
    GOTO :GET_FILE
)

FOR /F "tokens=* delims=" %%M in (%File%) do call :PROCESS "%%M"
ECHO.
ECHO Complete.
POPD
EXIT /B

:PROCESS
SET Machine=%~1
SET Machine=%Machine: =%
PING -n 1 %Machine% >>NUL
IF %ERRORLEVEL% EQU 0 ECHO %Machine% >>"%OnlineFile%"
EXIT /B
:-------8<-------------------------------- FileName.bat ---------------------------------------------:

HTH :-)

gL,
[r.D]
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now