Salve ragazzi.
Ho messo in piedi questo batch per pingare un range di IP e mi rilascia a video gli IP attivi o meno.
Adesso voglio che ad ogni IP attivo mi scriva su un txt Computername, IP, SerialNumber, Product...
sono riuscito anche a trovare il comando per questo tramite wmic, ma impostando /node è necessario specificare il nome macchina e non l'indirizzo IP, quindi non riesco a settare in automatico che ad ogni IP attivo decifri il nome macchina (ping -a) e poi lo inserisca dopo /node:
Insomma è più facile se leggete lo script
@echo off
setlocal enabledelayedexpansion
:Timeout
Set t0=500
:startIP
Set t1=0
:endingIP
Set t2=254
Set t4=192.168.1.
for /L %%I in (%t1%,1,%t2%) do set t3=%%I & (ping %t4%%%I -n 1 -w %t0%
) & call:e!errorlevel!
for /L %%I in (0,1,4) do set t%%I=
goto:eof
:Subroutines
:e0
echo %t4%%t3% exists
echo %computername% >>log.txt
echo %t4%%t3% >>log.txt
wmic /node:%computername% os get CSName >>log.txt
wmic /node:%computername% bios get serialnumber >>log.txt
wmic /node:%computername% csproduct get name >>log.txt
goto:eof
:e1
Echo %t4%%t3% does not exist
goto:eof