Solved

Registry Edit Script

Posted on 2008-10-02
10
579 Views
Last Modified: 2012-05-05
I need to push out a registry key change to my Windows XP SP3 machines.  HKEY_LOCALMACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID is the location.  What I need to do is change the permissions on the HardwareID folder for the "user" account to full pemissions.  I am wondering if there is a script I can write for this.

0
Comment
Question by:ianbasis
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 22

Expert Comment

by:Paka
ID: 22625362
Looks like you can shell an instance to regini.exe to do it:
http://www.experts-exchange.com/Programming/Misc/Q_22143726.html
0
 
LVL 22

Expert Comment

by:Paka
ID: 22625440
Save the attached code to a file named regchange.vbs

Call the code from the logon script using:
cscript regchange.vbs
set oFSO = CreateObject("Scripting.FileSystemObject")
strFileName = oFSO.GetTempName
 
set oFile = oFSO.CreateTextFile(strFileName)
oFile.WriteLine "HKEY_LOCALMACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID [1 5 7 11 17]"
oFile.Close
 
set oShell = CreateObject("WScript.Shell")
oShell.Run "regini " & strFileName, 8, true
oFSO.DeleteFile strFileName

Open in new window

0
 

Author Comment

by:ianbasis
ID: 22625448
I am not fimiliar with this so it looks a bit too complicated.  Is there anything else I can do, or is there an example for me too follow?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 2

Expert Comment

by:TCC_HD
ID: 22625477
It looks like you can do it with a simple batch file.

See this http://support.microsoft.com/kb/245031

-TCC
0
 

Author Comment

by:ianbasis
ID: 22626494
It doesn't seem to work.  Maybe I am doing something wron.  I have set the Gp to run the regchange.vbs upon login.  Is that the correct way?

0
 

Author Comment

by:ianbasis
ID: 22627881
that works but now users are getting a permissions denied error when the script runs.  How can I fix that?
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 22628849
Hi, just use Group Policy to set the registry permissions, if you're in an Active Directory environment.
http://www.lockergnome.com/windows/2005/01/11/set-registry-permissions-using-group-policy/
http://technet.microsoft.com/en-us/library/cc756952.aspx

Regards,

Rob.
0
 
LVL 14

Expert Comment

by:Dhiraj Mutha
ID: 22632793
Try this script,
 
Save it as permission.vbs

set oFSO = CreateObject("Scripting.FileSystemObject")
strFileName = oFSO.GetTempName
set oFile = oFSO.CreateTextFile(strFileName)
oFile.WriteLine "HKEY_LOCALMACHINE\SOFTWARE\Microsoft\MSLicensing\HardwareID [1 5 7 11 17]"
oFile.Close
set oShell = CreateObject("WScript.Shell")
oShell.Run "regini " & strFileName, 8, true
oFSO.DeleteFile strFileName
'WScript.Echo "Done!"
0
 

Author Closing Comment

by:ianbasis
ID: 31502418
Very easy way to do this.  Thanks!!
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22639265
No worries. Thanks for the grade.

Regards,

Rob.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to make an ADE file by code? 11 83
What is this Task? 4 110
Transfer configuration between Windows XP installations 4 55
Batch file or script with password 22 42
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question