Article View: comp.os.netware.misc
Article #186Re: Having a batch file auto-detec the NIC address
From: H. E. McDorman
Date: Thu, 31 Oct 1996 00:00
Date: Thu, 31 Oct 1996 00:00
35 lines
2039 bytes
2039 bytes
In article <327fd06a.8849461@news.execpc.com>, tom.kustner@emjay.com (Tom Kustner) wrote: >We have our PC install batch files automated except for one item: > >We currently have to tell the batch file which type of NIC card the >machine has (we have four types). We have several utilities, like >SYSCHK, which can write the NIC address (along with other info) to a >file. However, I don't know how to read a file in DOS or if there's a >nifty way to set a variable to a NIC address. Of course, we would >then test it to see who the manufacturer is. > >Does anyone have any good ideas? > Someone probably has a nifty utility for this... our workarounds: In login script, set P_STATION to an environment variable. You can take just the first 6 digits (assuming your 4 different types of cards are all by different manufacturers). set ps=P_STATION>>6 Or PC Magazine has a neat freeware utility called STRINGS that among other things can get and manipulate environment variables. Use FIND to get the desired line out of SYSCHK, pipe it into STRINGS. Use STRINGS to get the desired section of the line. Yeah, cludgy, but it works. eg, Say the unique word in the desired line is "NIC", and the NIC address starts at column 15: SYSCHK|FIND "NIC"|STRINGS ps=ask,80,2 STRINGS ps=mid %ps%,6,15 Either way you get an environment variable you can check in the batch file. -- H.E.McDorman usual disclaimer - the opinions expressed above are entirely my own. ***
Technical Details
Message-ID:
<55att2$6oj@usenet.Hydro.ON.CA>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<327fd06a.8849461@news.execpc.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fe659,cbfb9882fdbabed8 X-Google-Attributes: gidfe659,public X-Google-Thread: f8bf7,cbfb9882fdbabed8 X-Google-Attributes: gidf8bf7,public From: heather.mcdorman@hydro.on.ca (H. E. McDorman) Subject: Re: Having a batch file auto-detec the NIC address Date: 1996/10/31 Message-ID: <55att2$6oj@usenet.Hydro.ON.CA> X-Deja-AN: 193690505 references: <327fd06a.8849461@news.execpc.com> organization: Ontario Hydro, Canada newsgroups: comp.os.netware.misc,bit.listserv.novell