Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return Computer Info 1

Status
Not open for further replies.

Sylv4n

Technical User
Feb 27, 2002
83
0
0
GB
Hi I am looking for some code to return some information about the computer that it is run on. I want to return:

Computer Make
Computer Model
Computer Model Number
Computer Serial Number

I am aware that this information may not be avalable but I was wandering if anyone could help.

Many Thanks
Sylvan
 

Hi,

you might make out better posting this in forum222

Skip,
[sub]
[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue][/sub]
 
Hi Sylvan,

There must be a way to do (at least some of) this, but I'm not sure exactly what you're after.

The Computer Make and Model (like, say, Dell Dimension) are not hard wired in. You may see some info in My Computer > Properties but the manufacturer can put what they want there and the (savvy) User can change it although I don't know why they would want to.

The motherboard make and model and various other details are hardwired in, and must be available. Computers don't necessarily have Models and Model Numbers, or Serial Numbers, so I don't know what you are looking for with them.

If you post back with exactly what information you want I will see what I can do.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Hi Tony
Yeah let me explain the situation.

I work for a large company and we are installing Windows XP on a large scale (on 500 odd PC's) so we are using a automated process to install windows. But for every computer that I install Windows XP on I need the following information

Computer Name - I can get this with Enviromen("Computername") or something like that
Computer Make - for example HP Compaq
Computer Model - For example D5s or whatever
Computer Nodel Number - Not that important, becouse if I can get the model thant I can store the model number next to the model and retreve it from that list
Computer Serial Number - This is the serial number on the case of the computer, but again I am not sure if as you say this is hardwored into the computer

now its easy to see all of this information on the case of the computer, but as I say I will be doing this several hunderad times, and loving to write a little code to speed things up I wanted to automate getting this information.

Another thought is that these computers get the serial number from the motherboard, if there is VBA code to get the serial number off the motherboard then I could compare that with what is on the computer.

Many thanks
Sylvan
 
Hi Sylvan,

AFAIK, there is no way to prise "HP Compaq" out of the hardware so you have to rely on someone having put it in there. You could try looking in oeminfo.ini in Windows/System32 (I think).

Again I don't know about actual serial numbers of PCs - network cards have a unique "MAC ID" which is often used for this kind of thing (you can get it via ipconfig - it calls it physical address or something)

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Tony,
What does AFAIK mean?
Anyway I could not find that oeminfo.ini but I have been able to locate the meodel type in the registery, it is created in a folder under the name of the company that designed our automated build, From that I could do the Model & Model Number and maybe even the make,
Looking in Registry for the serial number and no luck :( guess I am just gonna have to resort to typing it in manually :( oh well

Thanks anyway :) - it was your idea of oeminfo that inspired me to look into the registry
Sylvan
 
AFAIK = As Far As I Know

Rgds, Geoff

Three things are certain. Death, taxes and lost data. DPlank is to blame

Please read FAQ222-2244 before you ask a question
 
Hi Sylvan,

Sorry, I try to avoid abbreviations but that one slipped through.

If you have registry information like that, then it might be worth asking the company that did the build for you (or checking their documentation) to see if they've hidden any other details anywhere. Searching the registry is not necessarily successful if there is any kind of encoding.

Just out of curiosity, what format are your serial numbers in?

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Just a random thought as I'm passing through....
Does your assest register not hold any of the information being sought??

Happy Friday

;-)
If a man says something and there are no women there to hear him, is he still wrong? [ponder]
How do I get the best answers?
 
that is why I am colecting this infomation to put into a asset register, we are using the opertunity of transfering everyone to XP to ensure that the asset register is up to date.
 
I was looking for an answer to the very same question and came accross this - - - what a wealth of info.
P.S.... If you want the serial number you can change the code as shown:

Set objWMIService = GetObject( "winmgmts://./root/cimv2" )

Set colItems = objWMIService.ExecQuery( "Select * from Win32_BIOS where PrimaryBIOS = true", , 48 )

For Each objItem in colItems
strMsg = strMsg _
& " BIOS Name : " & objItem.Name & vbCrLf _
& " Version : " & objItem.Version & vbCrLf _
& " Manufacturer : " & objItem.Manufacturer & vbCrLf _
& " Serial Number : " & objItem.SerialNumber & vbCrLf _
& " SMBIOS Version : " & objItem.SMBIOSBIOSVersion & vbCrLf
Next

WScript.Echo strMsg
 
Wow thanks Mikaki,
I must admit I had given up hope of finding this information. So all this informaiton is comming from the BIOS? Is there any other particularly usefull infomation that I can pull out of there?

Good job :) :)

Many Thanks
Sylvan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top