Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to update variables list

14 views
Skip to first unread message

Petr Laznovsky

unread,
May 5, 2013, 5:03:15 PM5/5/13
to
Writing batch to monitor (via external utility) some network devices. Utility scan network and print
list of MAC address of all actually connected devices. On initial round will enumerate them and put
in the pseudo field like this:

set lmac;%dev_num%=%mac%;%fw_ver%;%hw_ver%

Than periodically run some other routine through this list and read some additional data for each
MAC on the list and display them on screen.

Because sometime somebody unexpectedly disconnect some device from network, and/or plug new device
into network, in specific interval will run some other routine which read actually alive devices and
should refresh original device list. Refresh means delete devices not in new list and add newly
occured devices. Note the total number of devices can stay unchanged.

Here I am stuck. Feel all ways I can realize to do this are too clumsy and make batch too slow. I am
looking for some tricky solution from clever heads. Described "field" structure is not dogma, with
high probability I will have redesign it from scratch ;-)

thanks L.

foxidrive

unread,
May 6, 2013, 1:09:01 AM5/6/13
to
Use a prefix like aaa on the variable names and then code like this should clear them all - and rerun the
utility to repopulate the device list.


for /f "delims==" %%a in ('set aaa') do set %%a=



--
foxi

Petr Laznovsky

unread,
May 6, 2013, 3:42:58 AM5/6/13
to
Dne 6.5.2013 7:09, foxidrive napsal(a):
I forget to write one important thing: Utility may not print MACs in same order each time and I do
not want to order MACs on the screen list changes every time, it can produce discomfort for screen
watcher. Thus I prefer to update field, not delete it and assemble again from scratch.

foxidrive

unread,
May 6, 2013, 4:34:06 AM5/6/13
to
You could sort the display by mac address.


--
foxi

Petr Laznovsky

unread,
May 6, 2013, 9:02:22 AM5/6/13
to
Dne 6.5.2013 10:34, foxidrive napsal(a):
Good idea, but IMHO still does not solve situation when new devices will be pluged-in and by MAC
address will be added at the top of the list. New devices should be added at the bottom of list.

L.

0 new messages