Support Forums

Full Version: HWID Generater Script (vbs)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I got this small script, you can get your hwid from this easily Big Grin


Code:
Function GetCpuID()
Dim wmi, cpu
Set wmi = GetObject("winmgmts:")

  For Each cpu in wmi.InstancesOf("Win32_Processor")
      wscript.echo "CPU: " & cpu.ProcessorID    
  Next
End Function

GetCpuID()



just copy all this and paste it in notepad and then save it as
cpuid.vbs or as any other name Big Grin
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:
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.
(08-21-2011, 08:28 AM)Ace Wrote: [ -> ]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:
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.

ok Thanks buddy, i am just new in these things Big Grin
Give this script I created a shot then Smile
Code:
Set wmi = GetObject("winmgmts:")
    For Each cpu in wmi.InstancesOf("Win32_Processor")
        MsgBox "CPU: " & cpu.ProcessorID, 64, "HWID Generation"
      
        Set WriteFile = CreateObject("Scripting.FileSystemObject")
        Set Writer_ = WriteFile.OpenTextFile("Generated_ID.txt", 8, True)
        Writer_.WriteLine("# HWID Generation:" & _
            vbNewLine & _
            "-- CPU: " & cpu.ProcessorID)
            
        Writer_.Close
        SET Writer_ = Nothing
        SET WriteFile = Nothing
    Next

It will create an output of the ID to a text file in the same location/directory you execute the script.
gonna try to use this.
Thanks brother