Geeks help me

Anything off topic that you want to share with the group. (warning this board may include coarse language)

Moderators: IMC, Club Staff

Post Reply
Dr_Jones
Veteran Mechanic
Posts: 848
jedwabna poszewka promocja
Joined: Tue Sep 10, 2002 5:00 pm
Location: Brisbane
Contact:

Geeks help me

Post 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
User avatar
nicholas
Veteran Mechanic
Posts: 1091
Joined: Thu May 17, 2007 5:00 pm
Location: Hills, NSW

Post by nicholas »

Yeah, would help but... beer FTW lol.
Dr_Jones
Veteran Mechanic
Posts: 848
Joined: Tue Sep 10, 2002 5:00 pm
Location: Brisbane
Contact:

Post by Dr_Jones »

Bahhhh
Dr_Jones
Veteran Mechanic
Posts: 848
Joined: Tue Sep 10, 2002 5:00 pm
Location: Brisbane
Contact:

Post by Dr_Jones »

Anyone?
User avatar
I8A4RE
QLD Coordinator
Posts: 9594
Joined: Mon Aug 28, 2006 5:00 pm
Location: BOOSTIN in front of you
Contact:

Post by I8A4RE »

Sorry man you lost me at pinging :?
CHRISTIANITY: The belief that a cosmic Jewish Zombie who was his own father can make you live forever if you symbolically eat his flesh and telepathically tell him you accept him as your master, so he can remove an evil force from your soul that is present in humanity because a rib-woman was convinced by a talking snake to eat from a magical tree...
User avatar
Ed_EViL
Grease Monkey
Posts: 156
Joined: Fri Dec 15, 2006 6:00 pm
Location: South Sydney

Post 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....
Dr_Jones
Veteran Mechanic
Posts: 848
Joined: Tue Sep 10, 2002 5:00 pm
Location: Brisbane
Contact:

Post 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.
Post Reply