+ Post New Thread
Results 1 to 9 of 9
How do you do....it? Thread, SMBIOS ? in Technical; Trying to do a wmi script to post back and let me know what memory type I have on my ...
  1. #1

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,901
    Thank Post
    3,428
    Thanked 1,082 Times in 998 Posts
    Rep Power
    370

    SMBIOS ?

    Trying to do a wmi script to post back and let me know what memory type I have on my computer using the win32_physicalmemory class but I keep getting zero ( 0 ) returned which as per the class info page states its unknown which I found this ms kb about :

    A WMI query for the memory type and for the form factor on a Windows Server 2003-based computer returns 0x0 for each entry

    Quote from a word doc which is attached

    Microsoft System Management BIOS Driver

    The Microsoft SMBIOS driver (mssmbios.sys) is a root-enumerated driver included with Windows XP SP2 and Windows Server 2003 SP1 and has two primary functions:

    * To incorporate SMBIOS, ACPI, and CPU information to the crash dump file when a system crash occurs.
    * To retrieve system identification information from SMBIOS and make it available to system components and applications.



    There are two primary benefits to the Microsoft SMBIOS driver:

    * Adding system firmware information to the crash dump aids in failure diagnosis. A given root cause may be linked to a specific system vendor or to specific hardware attributes, such as the type and size of memory modules. This information is available in SMBIOS.
    * Identifying a given hardware platform. Scenarios such as branding, BIOS update, and targeted driver installation require a reliable, stable method for identifying the underlying hardware platform. These scenarios require information about basic attributes of the system, such as the system manufacturer and current BIOS version.
    I currently have windows xp SP 2 32 bit so is there anyway I can update this file so I get the correct info returned from the wmi querry via vbscript or do I need to update my bios via the download support page or what exactly ?

    If not then is there another way of querrying the memory type ?
    Attached Files Attached Files
    Last edited by mac_shinobi; 17th February 2010 at 09:16 AM.

  2. #2

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,240
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    What VBS WMI query are you using, usually if it does not return the RAM type it is because the BIOS does not support teh way windows uses to gather the information. Also the RAM type variable if I recall is not that useful as it does not distinguish between DDR and DDR2 ram or at least did not in XP when I tried. I suggest that you use this WMI Explorer to have a poke around in WMI as it is very useful for this kind of thing.

    This is also epic for creating the code and will give you the translations from number to memory type to http://www.microsoft.com/downloads/d...displaylang=en

    This is the relevant MSDN page that decodes it for you Win32_PhysicalMemory Class (Windows)

    If the BIOS does not present this in a way that the PC can get at it there is another way but it requires using the WMI BIOS calls to dump a copy of the BIOS config area then looking through that. There is code and an explaination that will do it locally here SMBIOS Demystified - CodeGuru but I have never reimplemented it as managed code to process the data dumped of the WMI call.

    More background about my dealings with this here http://www.edugeek.net/forums/blogs/...computing.html

  3. #3

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,901
    Thank Post
    3,428
    Thanked 1,082 Times in 998 Posts
    Rep Power
    370
    The Code I tried that I found on a website is below

    Code:
    Dim servername:servername="."
    
    For Each objMem In GetObject("winmgmts:{impersonationLevel=impersonate}\\" & servername & "\root\cimv2").InstancesOf("Win32_PhysicalMemory")
                    Select Case objMem.MemoryType
                        Case 0
                            rtype = "Unknown"
                        Case 1
                            rtype = "Other"
                        Case 2
                            rtype = "DRAM"
                        Case 3
                            rtype = "Synchronous DRAM"
                        Case 4
                            rtype = "Cache DRAM"
                        Case 5
                            rtype = "EDO"
                        Case 6
                            rtype = "EDRAM"
                        Case 7
                            rtype = "VRAM"
                        Case 8
                            rtype = "SRAM"
                        Case 9
                            rtype = "RAM"
                        Case 10
                            rtype = "ROM"
                        Case 11
                            rtype = "Flash"
                        Case 12
                            rtype = "EEPROM"
                        Case 13
                            rtype = "FEPROM"
                        Case 14
                            rtype = "EPROM"
                        Case 15
                            rtype = "CDRAM"
                        Case 16
                            rtype = "3DRAM"
                        Case 17
                            rtype = "SDRAM"
                        Case 18
                            rtype = "SGRAM"
                        Case 19
                            rtype = "RDRAM"
                        Case 20
                            rtype = "DDR"
                        Case 21
                            rtype = "DDR-2"
                    End Select
                    wscript.echo " Memory Bank: " &  objMem.BankLabel
                    wscript.echo " Memory Size: " & objMem.Capacity/1024/1024 & " MB"
                    wscript.echo " Memory Speed: " & objMem.Speed & " MHZ"
                    wscript.echo " Memory Type: " & rtype
                    wscript.echo ""
                next
    
                set objMem = nothing
    That just returns unknown as it is giving me that 0 error because of the smbios or w/e will look into the code project way of doing it

    ta

  4. #4

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,240
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    That code does work for me on this PC so it may be the one you are trying it on or the OS (7 here). It is much more likely to work on a brandname box as alluded to in the blog post above. HP, Dell, Lenovo and Acer have all performed well for me in this kind of test.

  5. #5

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,901
    Thank Post
    3,428
    Thanked 1,082 Times in 998 Posts
    Rep Power
    370
    Quote Originally Posted by SYNACK View Post
    That code does work for me on this PC so it may be the one you are trying it on or the OS (7 here). It is much more likely to work on a brandname box as alluded to in the blog post above. HP, Dell, Lenovo and Acer have all performed well for me in this kind of test.
    Am using a Dell Optiplex 755 and getting the unknown error - which util would I need or how would I do this ??
    Last edited by mac_shinobi; 17th February 2010 at 01:14 PM.

  6. #6

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,240
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    In which case I blame XP, it was pretty rubbish with certain aspects of WMI, so much so that I stopped bothering till later versions for grabbing anything indepth reliably about certain configuration options.

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,901
    Thank Post
    3,428
    Thanked 1,082 Times in 998 Posts
    Rep Power
    370
    Quote Originally Posted by SYNACK View Post
    In which case I blame XP, it was pretty rubbish with certain aspects of WMI, so much so that I stopped bothering till later versions for grabbing anything indepth reliably about certain configuration options.
    lol Am on windows xp pro SP 3 - dont suppose there is an updated smbios sys file ?

  8. #8

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    11,240
    Thank Post
    882
    Thanked 2,742 Times in 2,316 Posts
    Blog Entries
    11
    Rep Power
    784
    Not for that version of Windows if you have SP3 then you have the latest one.

  9. #9

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,901
    Thank Post
    3,428
    Thanked 1,082 Times in 998 Posts
    Rep Power
    370
    Quote Originally Posted by SYNACK View Post
    Not for that version of Windows if you have SP3 then you have the latest one.
    ah fudge Will skip over this for now and come back to this later on - obviously and clearly the operating system

    cheers

    edited - downloaded and ran cpu z and that detects and gets all the info but am assuming they must of made there own dll or something along those lines to get the relevant info in some way shape or form ?
    Last edited by mac_shinobi; 17th February 2010 at 07:18 PM.

SHARE:
+ Post New Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •