Jump to content

Check Windows Genuine Validation


Recommended Posts

I've looked around the forums already but I didn't find anything on this topic. What I want to do is somehow check (preferably with native autoit code) if windows is genuine or not. I need to do something like:

$check = check_windows();~ check if windows is genuine
If $check = 1 Then
GUISetState(@SW_SHOW)
Else
MsgBox(0,"Invalid","This copy of windows is not genuine.")
EndIf

Something like that ^ but I can't think of how to do this. It doesn't specifically have to be exactly that but somehow check the validation and return a result as an int or as True/False. Can anyone help me with this?

Link to comment
Share on other sites

@dbzfanatic

Maybe this can help

ConsoleWrite( _Determine_Operating_System_Status() & @LF & @LF)

Func _Determine_Operating_System_Status()
    Local $j_Text = ''
    Dim $Obj_WMIService = ObjGet('winmgmts:{impersonationLevel=impersonate}!\\' & @ComputerName & '\root\cimv2');
    If (IsObj($Obj_WMIService)) And (Not @error) Then
        Dim $Col_Items = $Obj_WMIService.ExecQuery('Select * from Win32_WindowsProductActivation')
        
        Local $Obj_Items
        For $Obj_Items In $Col_Items
            Global $Active_Require = $Obj_Items.ActivationRequired
            
            Switch $Active_Require
                Case 0
                    Local $j_Text = 'Activation Not Required' & @CRLF
                Case 1
                    Local $j_Text = 'Activation Is Required' & @CRLF
                Case Else
                    Local $j_Text = 'unknown' & @CRLF
            EndSwitch
            
            $j_Text &= 'Remaining Evaluation Period (in days): ' & $Obj_Items.RemainingEvaluationPeriod & @CRLF
            $j_Text &= 'Remaining Grace Period: (in days): ' & $Obj_Items.RemainingGracePeriod
        Next
        
        Return String($j_Text)
    Else
        Return 0
    EndIf
EndFunc

regards

ptrex

Link to comment
Share on other sites

Thanks for the reply, it does check the activation but I also need to check to see if it's a genuine copy or not. This way if it is activated AND genuine I can do something (probably only something simple/stupid like put a windows logo somewhere but I think it'd be cool.) I can use this to check activation but is there a way to check if a copy is genuine or not as well?

Link to comment
Share on other sites

@dbzfanatic

Once the license is checked and found OK it remains like that.

If you want to check it again you will have to go throught the Windows Geniune Advantage (WGA) process again.

This might give you a hint on how to.

WGA reactivation

regards

ptrex

Edited by ptrex
Link to comment
Share on other sites

$x = ObjGet("winmgmts:{impersonationLevel=impersonate}")

$y = $x.InstancesOf("win32_WindowsProductActivation")

For $Obj In $y

If $Obj.ActivationRequired Then

MsgBox(4096, 'WPA Check', 'Windows is NOT activated!')

Else

MsgBox(4096, 'WPA Check', 'Windows is already activated!')

EndIf

Next

Link to comment
Share on other sites

  • 1 year later...

$x = ObjGet("winmgmts:{impersonationLevel=impersonate}")

$y = $x.InstancesOf("win32_WindowsProductActivation")

For $Obj In $y

If $Obj.ActivationRequired Then

MsgBox(4096, 'WPA Check', 'Windows is NOT activated!')

Else

MsgBox(4096, 'WPA Check', 'Windows is already activated!')

EndIf

Next

This works perfectly on xp, is there a way to make it work with vista?

thanks

Link to comment
Share on other sites

just being curious, i have an understanding that few pirated copies of windows look like they have been activated (i used to think that may be these pirates would drop a reg key to disable the prompt to activate the windows)

in this case, WGA wont be checked with checking only the registry key isnt it. specially finding out if windows copy is genuine would require checking up visiting http://www.microsoft.com/genuine/validate/?displaylang=en&sGuid=490b5bb4-b1f1-4adc-9da2-69bdac622b05 using IE or using the WGA plugin in case of other browsers.

pls correct me if this tool still just looks up the corresponding reg key or it does more !

Link to comment
Share on other sites

I wouldn't imagine checking activation required is the same as checking if it is activated.

No, it's the opposite and that's exactly why that code is valid. The bad part is that the people replying didn't read the part where the OP was asking about WGA (Windows Genuine Advantage) which checks to see if the product is indeed genuine and not a pirated copy, not WPA (Windows Product Activation) and there is a major difference between the two. Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...