How to processor id show on form in a text box

meenctg

Learn24bd
Local time
Today, 07:23
Joined
May 8, 2012
Messages
133
I have a form and a text box. I wanna when open this form in the text box my pc processor id will show. I know i have to use form load event but i have not skill in vb. Please help me.
 
You can assign the "PROCESSOR_IDENTIFIER" environment variable to a textbox with this code . . .
Code:
Me.text0 = Environ("PROCESSOR_IDENTIFIER")
 
Thanks lagbolt for your response. I wanna the unique cpu id that's mean setial number which is unique id for every intel processor. Hopefully you will help me to do this.
 
Code copied from http://www.ozgrid.com/forum/showthread.php?t=62635

Code:
    Dim cimv2, PInfo, PItem ' no idea what to declare these as
    Dim PubStrComputer As String
    PubStrComputer = "."
    
    Set cimv2 = GetObject("winmgmts:\\" & PubStrComputer & "\root\cimv2")
    Set PInfo = cimv2.ExecQuery("Select * From Win32_Processor")
    For Each PItem In PInfo
        MsgBox ("Processor: " & PItem.Name & vbCrLf & "Id: " & PItem.ProcessorId)
    Next PItem
 
Code:
    Set cimv2 = GetObject("winmgmts:\\" & PubStrComputer & [COLOR="Red"]"\root\cimv2"[/COLOR])

Thanks for your response. I have faced a litle bit problem for marked red code i have remove this code and it is working fine. Final i have solved my problem.
 
If you solved it, everything is Ok.
 

Users who are viewing this thread

Back
Top Bottom