Hi, i want to check the license status on Windows 8/7, i found a way but it's not very safe, i mean it could trigger errors. So anyone knows a way to retrieve the license status on Windows 87 ? Maybe using the registry ?
Thanks, but can you give more details please? If "SLIsWindowsGenuineLocal" is a function, then i don't find it on the net or msdn. Edit: After deep search i found the function but i need an example or more details on it, but i'll try thanks...
What to see if the OS is activated? Code: Private Sub bgwls(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgwls.DoWork Try Dim status As String status = String.Empty Dim objMgmt As System.Management.ManagementObject Dim LicenseStatus As New System.Management.ManagementObjectSearcher("root\CIMV2", "SELECT LicenseStatus FROM SoftwareLicensingProduct") For Each objMgmt In LicenseStatus.Get If objMgmt("LicenseStatus") = "1" Then status = "Licensed" Exit For Else status = "Unlicensed" End If Next e.Result = status Catch ex As Exception 'Your error code End Try End Sub Private Sub bgwls_Completed(ByVal sender As Object, ByVal e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bgwls.RunWorkerCompleted Try status = e.Result Label1.Text = status Catch ex As Exception 'Your error code End Try End Sub bgwls is simply a background worker. This can easily be converted.
Just import the slc.dll from 'C:\Windows\System32' and call the function SLIsWindowsGenuineLocal() that's IntPtr and convert to DWORD in code. I've no extensive experience with C, but I participated in some projects on my life...
I feel you guys have not fully explained what the slc part does. SLIsWindowsGenuineLocal This is just the Software Licensing Client (SLC). SPPCEXT.dll is the file which actually activates the copy of Windows regardless of the Version from Vista - Windows 8 last I checked. IF my memory serves me correctly Microsoft created a License checking tool which was called the Microsoft Genuine Diagnostic Tool which was released again I believe in response to WAT which went after the permissions on one of the spp files. I would start with that diagnostic tool instead of the Software Licensing Client file. http://download.microsoft.com/download/9/F/3/9F3DED28-A521-4352-B8A4-20368D0CC1AA/MGADiag.exe
Windows 8 ships with it's own diagnostic tool Licensingdiag.exe, sure there's other apis available but SLIsWindowsGenuineLocal is simple to use and its invoked when you check activation status in control panel and also used by the metro ui.
Well i looked for WMI and heard it was lagging, not fast comparing to API, + i didn't manage to use SLIsGenuineLocal() in C, C# syntax is very different from C one i think
If you get stuck I can always whip up a project for you. Just let me know what language and IDE. Also, if you use WMI and code it correctly it will load instantly. People would usually put 'Select * From' when using WMI, that makes it cycle through everything in that instance instead of selecting what you want.
Well very nice from you The Dev, i'm using Visual Studio Ultimate with C (WinApi), and yes i'm somehow blocked since i can't use SLIsGenuineLocal(), so if you can do something, would appreciate thanks
WMI would be the best if you want more than just static version strings to be more dynamic http://msdn.microsoft.com/en-us/library/windows/desktop/aa389762(v=vs.85).aspx start here. its for C++ good luck
Ok no problem. Anyway, i dont need it right now since i'm really busy by school, but i'll still have a look to WMI or other stuff, maybe this week-end
you could also use cscript and start the slmgr.vbs process and take the output and use that data to your liking