Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScipt to change the Office 2003 product key

Status
Not open for further replies.

selenus

MIS
Apr 11, 2004
86
LV
Microsoft provide some helpful info how to change the product key for Office XP, for Office 2003, and for 2007 Office programs and suites.


Its based on editing Registry manually, instead of using VBScript. Drawback is that manual editing registry may cause serious problems if something done incorrectly.
How to implement this procedure in VBScript?
Code:
1. Close all Office programs. 
2. Click Start, click Run, type regedit, and then click OK. 
3. Locate and then click the following subkey:

For 2007 Office programs and suites:
HKEY_LOCAL_MACHINE \Software\Microsoft\Office\12.0\Registration
For Office 2003:
HKEY_LOCAL_MACHINE \Software\Microsoft\Office\11.0\Registration
For Office XP:
HKEY_LOCAL_MACHINE \Software\Microsoft\Office\10.0\Registration 
4. Export the Registration subkey. 

You can make a backup of the values under the Registration subkey if the new product key does not work. To do this, follow these steps:a.  Right-click the Registration subkey, and then click Export. 
b.  In the Save in list, select a location to save the registration entries. 
c.  In the File name box, type a name for the .reg file that you want to export, and then click Save. 

Note In steps 4a through 4c, you created a backup of the Registration subkey. You can restore the Registry settings of the Registration subkey by double-clicking the .reg file that you saved in step 4c. The contents of the .reg file are automatically exported to the Registry. 
5. Under the Registration subkey, there may be several Globally Unique Identifiers (GUID) that contain a combination of alphanumeric characters. Each GUID is specific to a program that is installed on your computer. 

Click a GUID. Then, view the version of Office that is listed in the right pane for the Productname registry entry. After you find the GUID that contains the version of your Office program, follow these steps:a.  Right-click the DigitalProductID registry entry, click Delete, and then click Yes. 
b.  Right-click the ProductID registry entry, click Delete, and then click Yes.

For more information about how to identify the correct GUID for the version of the Office suite or program that you have installed on your computer, click the following article numbers to view the articles in the Microsoft Knowledge Base: 
928516 ([URL unfurl="true"]http://support.microsoft.com/kb/928516/)[/URL] Description of the numbering scheme for product code GUIDs in 2007 Office suites and programs 
832672 ([URL unfurl="true"]http://support.microsoft.com/kb/832672/)[/URL] Description of numbering scheme for product code GUIDs in Office 2003 
302663 ([URL unfurl="true"]http://support.microsoft.com/kb/302663/)[/URL] Description of the numbering scheme for product code GUIDs for Office XP programs  
 
6. Close Registry Editor. 
7. Open an Office program, such as Microsoft Word. When you receive a message that prompts you for the product key, type the correct product key, and then click OK.
 
have a look at the

Set WshShell = CreateObject("Wscript.Shell")
strTemp = WshShell.RegRead(>>>
 
thats clear that script should contain
Set WshShell = CreateObject("Wscript.Shell")

Not clear for full code...
 
selenus,

If you are looking for someone to just do the work for you then you should contract someone to do it.

If on the other hand you would like some general advice on overall steps, or would like people to review your code and help you debug it, then we are here to help.

Because you need to enumerate keys in the registry, you need to read up on the use of StdRegProv. This is how WMI reads the registry. It has the ability to enumerate sub keys and help you find the GUID you are looking for. Writing to the registry can be done with the same provider. The advantage of using WMI over local vbscript for this task is the ability to affect remote machines.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Thanks. Sure, its helpful and definitely expand my knowledge. But I still have no VBScript knowledges enough to formalize the idea and create script correctly.

Microsoft have example WMI script that changes the volume licensing product key; why not make the same one for MS Office products??

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top