08-21-2011, 08:28 AM
(This post was last modified: 08-21-2011, 08:33 AM by AceInfinity.)
You know you don't need it inside of a function, the function is really useless if it's the only part of your code. Just makes things more complicated than they have to be. You can do something like this instead:
That's all the code you need. You don't even need to define cpu because it's being used as it's own parameter in the For Each loop.
Code:
Set wmi = GetObject("winmgmts:")
For Each cpu in wmi.InstancesOf("Win32_Processor")
MsgBox "CPU: " & cpu.ProcessorID, 64, "HWID Generation"
Next
That's all the code you need. You don't even need to define cpu because it's being used as it's own parameter in the For Each loop.