dbzfanatic Posted May 4, 2008 Share Posted May 4, 2008 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? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
ptrex Posted May 4, 2008 Share Posted May 4, 2008 @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 Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Valuater Posted May 4, 2008 Share Posted May 4, 2008 (edited) ??? Activation Not Required Remaining Evaluation Period (in days): 2147483647 Remaining Grace Period: (in days): 2147483647 Maybe... Case 0 Return 'Activation Not Required' 8) Edited May 4, 2008 by Valuater Link to comment Share on other sites More sharing options...
ptrex Posted May 4, 2008 Share Posted May 4, 2008 @Valuater Just grabbed it from the computerinfo.udf ?! regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
dbzfanatic Posted May 5, 2008 Author Share Posted May 5, 2008 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? Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
ptrex Posted May 5, 2008 Share Posted May 5, 2008 (edited) @dbzfanaticOnce 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 reactivationregardsptrex Edited May 5, 2008 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
yucatan Posted May 5, 2008 Share Posted May 5, 2008 $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 More sharing options...
weaponx Posted May 5, 2008 Share Posted May 5, 2008 I wouldn't imagine checking activation required is the same as checking if it is activated. Link to comment Share on other sites More sharing options...
am632 Posted January 5, 2010 Share Posted January 5, 2010 $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!') EndIfNextThis works perfectly on xp, is there a way to make it work with vista?thanks Link to comment Share on other sites More sharing options...
lordicast Posted January 5, 2010 Share Posted January 5, 2010 You could always run a check for WPAKILL in SyS32 [Cheeky]Comment[/Cheeky] Link to comment Share on other sites More sharing options...
rajeshontheweb Posted January 9, 2010 Share Posted January 9, 2010 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 ! Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
GEOSoft Posted January 9, 2010 Share Posted January 9, 2010 (edited) 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 January 9, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now