Jump to content

Automatically query Windows product Key embedded in Bios and activate windows


MattHiggs
 Share

Recommended Posts

This script attempts to resolve windows activation issues for devices that have been upgraded to windows 10 from older operating systems.  It queries Windows Management Instrumentation to query the OEM product key embedded in the device's BIOS and then attempts to activate windows using that key.  There are times where, even if the command reports that it failed, it still activated windows successfully.

#cs
 This script attempts to resolve windows activation issues for devices that have been upgraded to windows 10 from older operating systems.  It queries Windows Management Instrumentation to query the OEM product key embedded in the device's BIOS and then attempts to activate windows using that key.  There are times where, even if the command reports that it failed, it still activated windows successfully.
 #ce
 #include <AutoItConstants.au3>
 #RequireAdmin
 $proc = Run ( "wmic path softwarelicensingservice get OA3xOriginalProductKey", @SystemDir, Default, $STDOUT_CHILD )
 ProcessWaitClose ( $proc )
 $text = StdoutRead ( $proc )
 $one = StringInStr ( $text, "-" )
 $key = StringMid ( $text, Int ( $one ) - 5, 29 )
 RunWait ( @ComSpec & ' /c cscript //B "' & @WindowsDir & '\system32\slmgr.vbs" /ipk ' & $key )
 RunWait ( @ComSpec & ' /c cscript //B "' & @WindowsDir & '\system32\slmgr.vbs" /ato' )

 

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...