Solved

Registry Edit Script

Posted on 2008-10-02
10
578 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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now