Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

wmic batch with listing

Name: newbobtard 2013-09-25 9:56

Hello guys,

I need a batch file to scan a specific VLAN from 2 to 254 with wmic (for serialnumber) und write IP + according serial into a file. Where no serial is found and/or the request fails, I want a text to appear.
With how it currently is, he gives me the serials but where he can get none, he will not write anything. I can't match the serials to the IPs because of this ofc.
I have no idea how to implement the check for a result. This is my first more advanced batch file and all my research has left me more confused.

echo output of serials >> log.txt

@for /L %%N IN (2, 1, 254) DO echo 192.168.3.%%N >> log.txt
@for /L %%N IN (2, 1, 254) DO wmic /node: "192.168.3.%%N" bios get serialnumber >> log.txt

pause

I am pretty sure it is rather simple but I fuck it up every time I try something. I also have no clue how to check if the command leaves a result or not.

Thanks in advance!

Name: Anonymous 2013-09-25 10:08

install gentoo

Name: Anonymous 2013-09-25 10:09

...or use perl

Don't change these.
Name: Email:
Entire Thread Thread List