Page 1 of 1

Geeks help me

Posted: Wed Mar 12, 2008 9:31 pm
by Dr_Jones
Basically I have this file below. I want to check various pc's across a corporate network by pinging the pc name not the IP. I can put the pc name in the hosts.txt file and it works ok however, I want to also put a short description after the pc name that shows up in the results file. So basically I want to ping "PCname computer at station 10" and if I get no response I want that to show up in the results file not just the name.

Can anyone help?


@Echo Off





TITLE Visa Scale Connectvity Tester
DEL PINGresults.txt





SET MachineList=HOSTS.txt

SET ResultsFile=PINGresults.txt







CLS

ECHO.

IF NOT EXIST "%MachineList%" (

ECHO Cannot locate Machine List: %MachineList%

PAUSE>NUL

GOTO :EOF

)





FOR /f "tokens=*" %%M in (%MachineList%) do CALL :CHECK "%%M"
PINGresults.txt


GOTO :EOF



:CHECK

SET Machine=%~1

SET Machine=%Machine: =%



PING -n 1 %Machine%>NUL

Echo Processing %Machine%

IF %ERRORLEVEL% EQU 1 ECHO %Machine% did not respond at %Time%>>%ResultsFile%

EXIT /B



:EOF

Posted: Wed Mar 12, 2008 10:27 pm
by nicholas
Yeah, would help but... beer FTW lol.

Posted: Wed Mar 12, 2008 10:38 pm
by Dr_Jones
Bahhhh

Posted: Thu Mar 13, 2008 5:16 pm
by Dr_Jones
Anyone?

Posted: Thu Mar 13, 2008 5:21 pm
by I8A4RE
Sorry man you lost me at pinging :?

Posted: Fri Mar 14, 2008 10:06 am
by Ed_EViL
you know there's software out there for this sort of thing

it sounds like your trying to do a network audit
i think SMS has some tools which can help you out assuming
your a network admin....

Posted: Sat Mar 15, 2008 8:22 pm
by Dr_Jones
I'm not a network admin and although this is legit I don't want to deal with the IT people. Surely this script can me modified to do what I want to do.