Jump to content

Product Activation using VBS


Plamdi

Recommended Posts

A little while ago (2006) I was working on a way to automatically activate any genuine copy of Windows XP. It basically would attempt 2 forms of activation:

1. If OEM installation, attempt "pre-activation" mode.

2. Generate an Installation ID and prompt user (who could then choose Internet Activation or enter the data from phone activation or enter a new product key).

I decided such a program would no longer be as useful when SP3 was released because it overcame the "product key" issue (ie that you can install fully unattended without entering the product key, and then enter it and activate Windows). This program was not ever going to be intended for general public use. I may sometime (if I have the time) write a VBS program that prompts for the product key after installation is complete, I think that would be useful for some people who want to create an unattended disc that they can use with their friends and families, without having a product key in it (if you lend them your disc and they are prompted for their product key after installation, that will make sense to them and they can easily find the key and enter it). This is, obviously, most useful for OEM versions... which is the version that most of us will be used to.

I still think it would be useful for some people (especially those in the business of installing XP on customer Machines) to have an automated script to enter in the product key upon the installation of Windows.

This is an incomplete VBS file, do with it whatever you please... it does show you a proof-of-concept way to activate Windows through VBS (Internet or Phone)... It also shows you how to detect what version has been installed using the Product ID... it is however untested, and the OEM preactivation is not included. Maybe someone in the business of fixing computers can publish a full working version.

Option Explicit:On Error Resume Next
Dim WshShell,Obj,fso,K,P,T,isPro,pID,iID,cID,tmp:isPro=0:pID=""
' S - 0 = OEM Req Activation, 1 = Retail Req Activation, 2 = No Activation Req.
For each Obj in GetObject("winmgmts:").InstancesOf("win32_WindowsProductActivation")
' The following line could be run as a means to automatically attempt activation through OEM preactivation.
' If Obj.ActivationRequired And Mid(Obj.ProductID,7,3)="OEM" Then WSCRIPT.RUN("OEM Pre-activation")

' The following While could be used to prompt the user for activation.
While Obj.ActivationRequired
' Generate an Installation ID if new Product Key (Product ID).
If pID<>Obj.ProductID Then
tmp=Obj.GetInstallationID(iID)
pID=Obj.ProductID
End If
' The following lines can be used in conjunction with a prompt to change the product key.
' PROD_KEY=Replace(PROD_KEY,"-","")
' result=Obj.SetProductKey(PROD_KEY)

' The following line can be used in conjunction with a prompt to enter the confirmation ID from Phone activation to activate the product.
' result=Obj.ActivateOffline(ConfirmationID)

' The following line attempts internet activation.
' result=Obj.ActivateOnline()

' If unsuccessful try again (remember to give the user a way to break this loop if necessary).
Wned
Next

What I would be interested in seeing, sometime, or creating myself would be a file that average home users could use in their Windows installations to assist them in Product Activation. I still believe very firmly that activation is a very nauseating and confusing task for most people - I don't just mean Microsoft either, some friends of mine once purchased a product that required activation and even I couldn't get the stupid thing to activate. The company that produced the software used a third-party for activation, activation was only possible through internet... and for some reason it was impossible to activate through a standard Telstra ADSL connection.

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
  • Recently Browsing   0 members

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