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
Geeks help me
Moderators: IMC, Club Staff
-
- Veteran Mechanic
- Posts: 848
- jedwabna poszewka promocja
- Joined: Tue Sep 10, 2002 5:00 pm
- Location: Brisbane
- Contact:
-
- Veteran Mechanic
- Posts: 848
- Joined: Tue Sep 10, 2002 5:00 pm
- Location: Brisbane
- Contact:
-
- Veteran Mechanic
- Posts: 848
- Joined: Tue Sep 10, 2002 5:00 pm
- Location: Brisbane
- Contact:
- I8A4RE
- QLD Coordinator
- Posts: 9594
- Joined: Mon Aug 28, 2006 5:00 pm
- Location: BOOSTIN in front of you
- Contact:
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...
-
- Veteran Mechanic
- Posts: 848
- Joined: Tue Sep 10, 2002 5:00 pm
- Location: Brisbane
- Contact: