Registry Edit Script

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.

ianbasisAsked:
Who is Participating?
 
RobSampsonConnect With a Mentor Commented:
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
 
PakaCommented:
Looks like you can shell an instance to regini.exe to do it:
http://www.experts-exchange.com/Programming/Misc/Q_22143726.html
0
 
PakaCommented:
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
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
ianbasisAuthor Commented:
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
 
TCC_HDCommented:
It looks like you can do it with a simple batch file.

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

-TCC
0
 
ianbasisAuthor Commented:
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
 
ianbasisAuthor Commented:
that works but now users are getting a permissions denied error when the script runs.  How can I fix that?
0
 
Dhiraj MuthaLevel DCommented:
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
 
ianbasisAuthor Commented:
Very easy way to do this.  Thanks!!
0
 
RobSampsonCommented:
No worries. Thanks for the grade.

Regards,

Rob.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.