Results 1 to 19 of 19

Thread: Computer Inofmration

  1. #1

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188

    Computer Inofmration

    Hey all ,

    Does anyone know of a way to retrieve the fllowing:

    HDD size
    RAM Total Size
    OS and Serice Pack
    CPU Speed

    On every windows OS!

    Any help would be appreciated.

    thanks
    b

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Try looking up "WMI" at http://www.mvps.org for samples on these.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Member
    Join Date
    Oct 2000
    Location
    Europe
    Posts
    52
    I'm not sure how, but I remember in VB6 that if you added frmAbout Form, it contained a section 'System Info'.

    Take a look at the code behind it.

    Hope this helps

    MartinLG
    Tell me, and I will forget. Show me, and I will remember. Involve me, and I will care.

  4. #4
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Martin, this calls on the windows system information program - it's a bit like the shell command calling on another program to get this information so thiswon't really help this time.

    Course if he does use that one it'd save him a load of coding

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  5. #5
    Member
    Join Date
    Oct 2000
    Location
    Europe
    Posts
    52
    Correct, Alex!
    Tell me, and I will forget. Show me, and I will remember. Involve me, and I will care.

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    Re: Computer Inofmration

    Originally posted by Beacon
    Hey all ,

    Does anyone know of a way to retrieve the fllowing:

    HDD size
    RAM Total Size
    OS and Serice Pack
    CPU Speed

    On every windows OS!

    Any help would be appreciated.

    thanks
    b
    You need IS-IT-Legit for that.
    Only €1300 for a site license
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188

    Re: Re: Computer Inofmration

    Originally posted by plenderj
    You need IS-IT-Legit for that.
    Only €1300 for a site license
    I would do but it doesnt compare what i've got listed in my asset register with what it returns!
    Come on it ppl are lazy!!


    Thanks alex. I was assuming WMI has to be installed on 98 and NT though!
    b

  8. #8
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    The Microsoft SysInfo control provides a great way of gathering system information
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  9. #9

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    James but it doesnt supply this information.
    As far as i can gather!

  10. #10
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Found this in a search :

    A DLL file (moo.dll) with example. Will return your Operating System, Processor, Memory Information, Hard
    Drive Information (sample only shows drive C:\) Display Settings and
    Network Interface Information.

    <Attachment (DLL File) removed by admin due to potential 'badness' >
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  11. #11
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Beacon, I can send you on some source from IS-IT-Legit that will get that info if you want.
    All done through VB
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  12. #12
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    I really want to write a program that can do such stuff mind sending me the code plenderj (jamie right?)? can you send it to [email protected] ???? that would be really really nice of you if you did that

    btw why is it always that when you ask for something some people just point you to programs thata allready exist and can be downloaded while we want a source or something?
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  13. #13
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Ultimasnake : People are here to offer suggestions to your problems. Some may provide source code, other dll or ocx, while others may recommend applications. It's all help...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  14. #14
    Frenzied Member Ultimasnake's Avatar
    Join Date
    Feb 2002
    Location
    Amsterdam, holland
    Posts
    1,172
    Thats true , but shouldnt vb related stuff be vb source related? any program can be written in any language.. but i understand it, just think it is rather anoying sometimes.. when i ask for a way to get the computers name people say things like : download computer info , it's just 800 mb and costs only $1.000.000 .. ... neway... i understand :P
    For my PC and MS Smartphone 2003 software visit
    http://www.ultimasoftware.nl

  15. #15

    Thread Starter
    PowerPoster Beacon's Avatar
    Join Date
    Jan 2001
    Location
    Pub Floor
    Posts
    3,188
    Hye Guy's

    To clarify i've been contacting with Jamie for months now so his offer was legit (pun intended) it was a kind of jest!

    Jamie:
    ONE BIG THING!
    IS-IT-Legit NEEDS TO plug into or run with A.D do this using ADSI!

    b

  16. #16
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    I've just been getting into this myself http://216.26.168.92/vbsquare/demos/...Admin.cls.html
    or "Windows NT/2000 ADSI Scripting for System Administration" by Macmillan Technical Publishing ISBN: 1-57870-219-4 is a fantastic resource for ADSI scripting with vb!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  17. #17
    Fanatic Member
    Join Date
    Nov 2001
    Location
    Bangkok
    Posts
    969

    Hi Beacon

    I use this informations in a application. I downloaded from API.COM the code for it.

    nice greetings
    Franky
    (Still on the way to Bali? Maybe Thailand is better now ....)

  18. #18
    Fanatic Member scr0p's Avatar
    Join Date
    Oct 2002
    Location
    VA
    Posts
    720
    I think you can use SysInfo to get OS and service pack, Um, the code below is to get RAM, available RAM, and Vram and such:'
    (for this example you need to have label1)
    VB Code:
    1. Option Explicit
    2. Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
    3.  
    4. Private Type MEMORYSTATUS
    5.         dwLength As Long
    6.         dwMemoryLoad As Long
    7.         dwTotalPhys As Long
    8.         dwAvailPhys As Long
    9.         dwTotalPageFile As Long
    10.         dwAvailPageFile As Long
    11.         dwTotalVirtual As Long
    12.         dwAvailVirtual As Long
    13. End Type
    14.  
    15. Private memInfo As MEMORYSTATUS
    16.  
    17. Private Sub Form_Load()
    18. Call GlobalMemoryStatus(memInfo)
    19. memInfo.dwLength = Len(memInfo)
    20. Label1 = Int((memInfo.dwTotalPhys / 1024) / 1024) & " MB of RAM"
    21. End Sub

  19. #19
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    I have used this (got most of it from thsi board - thanks guys)

    Creat a form, call it frmmain, ad a text box - call it text1, and creat a command button - call it command 1.

    Past this into the form and you shoulf be good to go..

    Hopefully it will provide all the info you need..

    Rudy


    Option Explicit
    Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
    Private ComputerName As String

    Private Sub Command1_Click()

    Dim WMI
    Dim wmiWin32Objects
    Dim wmiWin32Object

    frmMain.MousePointer = vbHourglass
    frmMain.Command1.MousePointer = vbNoDrop
    frmMain.Text1.Text = "Connecting....."
    DoEvents
    On Error GoTo CanNotConnect
    Set WMI = GetObject("WinMgmts://" & ComputerName)
    Set wmiWin32Objects = WMI.InstancesOf("Win32_Processor")
    With wmiWin32Object
    For Each wmiWin32Object In wmiWin32Objects
    DoEvents
    frmMain.Text1.Text = "AddressWidth: " & .AddressWidth
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Architecture: " & .Architecture
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Availability: " & .Availability
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Caption: " & .Caption
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ConfigManagerErrorCode: " & .ConfigManagerErrorCode
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ConfigManagerUserConfig: " & .ConfigManagerUserConfig
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CpuStatus: " & .CpuStatus
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CreationClassName: " & .CreationClassName
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CurrentClockSpeed: " & .CurrentClockSpeed
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "CurrentVoltage: " & .CurrentVoltage
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "DataWidth: " & .DataWidth
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Description: " & .Description
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "DeviceID: " & .DeviceID
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ErrorCleared: " & .ErrorCleared
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ErrorDescription: " & .ErrorDescription
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ExtClock: " & .ExtClock
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Family: " & .Family
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "InstallDate: " & .InstallDate
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "L2CacheSize: " & .L2CacheSize
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "L2CacheSpeed: " & .L2CacheSpeed
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "LastErrorCode: " & .LastErrorCode
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Level: " & .Level
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "LoadPercentage: " & .LoadPercentage
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Manufacturer: " & .Manufacturer
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "MaxClockSpeed: " & .MaxClockSpeed
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Name: " & .Name
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "OtherFamilyDescription: " & .OtherFamilyDescription
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "PNPDeviceID: " & .PNPDeviceID
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "PowerManagementCapabilities: " & .PowerManagementCapabilities
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "PowerManagementSupported: " & .PowerManagementSupported
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ProcessorId: " & .ProcessorId
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "ProcessorType: " & .ProcessorType
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Revision: " & .Revision
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Role: " & .Role
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "SocketDesignation: " & .SocketDesignation
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Status: " & .Status
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "StatusInfo: " & .StatusInfo
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Stepping: " & .Stepping
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "SystemCreationClassName: " & .SystemCreationClassName
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "SystemName: " & .SystemName
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "UniqueId: " & .UniqueId
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "UpgradeMethod: " & .UpgradeMethod
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Version: " & .Version
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "VoltageCaps: " & .VoltageCaps
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Description: " & .Description
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "Manufacturer: " & .Manufacturer
    frmMain.Text1.Text = frmMain.Text1.Text & vbNewLine & "MaxClockSpeed: " & .MaxClockSpeed
    DoEvents
    Next
    End With
    frmMain.MousePointer = vbDefault
    frmMain.Command1.MousePointer = vbDefault
    DoEvents
    Exit Sub

    CanNotConnect:
    If Err.Number = 462 Then
    Call MsgBox("Unable to connect to " & ComputerName & vbNewLine & "Make sure you spelled the PC Name correctly with proper casing!", vbOKOnly + vbCritical, "No Connection")
    Err.Number = 0
    frmMain.MousePointer = vbDefault
    frmMain.Command1.MousePointer = vbDefault
    DoEvents
    Else
    Call MsgBox("Unable to connect to that PC" & vbNewLine & "Error # " & Err.Number & " - " & Err.Description, vbOKOnly + vbCritical, "No Connection")
    Err.Number = 0
    frmMain.MousePointer = vbDefault
    frmMain.Command1.MousePointer = vbDefault
    DoEvents
    End If

    End Sub
    Private Sub Form_Load()

    Dim NameSize As Long
    Dim X As Long
    Dim MachineName As String

    MachineName = Space$(16)
    NameSize = Len(MachineName)
    X = GetComputerName(MachineName, NameSize)
    ComputerName = Trim(MachineName)
    frmMain.Caption = frmMain.Caption & " - " & ComputerName
    DoEvents

    End Sub
    10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".

Posting Permissions

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



Click Here to Expand Forum to Full Width