Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HWID Generater Script (vbs)
#1
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
Don't try to act smart... i am smarter than you...Ninja
Reply
#2
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.
Reply
#3
(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
Don't try to act smart... i am smarter than you...Ninja
Reply
#4
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.
Reply
#5
gonna try to use this.
Thanks brother
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)