Solved

Registry Edit Script

Posted on 2008-10-02
10
577 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

11 Experts available now in Live!

Get 1:1 Help Now