What Does The Program Do Registers Custom Pkeys For Ie Registeriepkeys.exe
Use PowerShell to Easily Create New Registry Keys
Summary: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell to create new registry keys on local and remote computers.
Hey, Scripting Guy! I am often required to create new registry keys on our computers. One of the reasons for this is for occasional arrangement configuration. You meet, in our visitor the Group Policy team is the Group Policy squad. They do Grouping Policy—simply only for their own ends. They never make changes at the request of desktop support. In fact, they are reluctant to make any changes what-and then-ever. Of class, when y'all are in accuse of Group Policy for a multiforest, multidomain, international company with a presence on four continents, involving over a hundred-1000 machines, it is easy to empathise their reluctance. Additionally, in the by, a few misguided Grouping Policy Objects (GPOs) were practical, and they brought the network to its knees. Anyhow, long story curt, I need an easy mode to create new registry keys on our desktop machines.
—LL
Hello LL,
Microsoft Scripting Guy, Ed Wilson, is here. This morning is a coffee morning for me. I was up late terminal night finishing a mystery novel, so when the warning went off, it seemed like it was still "oh dark thirty," so I idea I would make a pot of Kona coffee in my French press while the Scripting Wife was busying herself making a couple of omelets. I am in my office listening to a new jazz/blues fusion CD that the post person brought to our house yesterday. I was on the treadmill at the time, and this is the first adventure I take had to requite it a spin.
I spent my time at the breakfast table (while waiting for the French Roast manor reserve beans to steep) reviewing my schedule. Here it is: the Scripting Wife and I are habitation for a few weeks, then we will exist on the road for a couple of weeks. We are heading due south, which when you already live in the deep south, by and large means Florida. On June i, 2012, we will be at the Atlanta TechStravaganza. I will be making a couple of presentations, and if it is anything like it was last year, the day should be a ton of fun with tremendous learning and networking opportunities. Check out the customs folio for more information about where I will be in the next month or and then.
LL, your story is, unfortunately, not uncommon. I was talking to several IT Pros at the Marker Minasi conference in Virginia Beach last week, and they echoed your sentiments—Group Policy seems to exist a rather large hammer with which to insert glazier points. Luckily, many of the tasks that are done via Group Policy are configurable through the registry. In fact, there are Grouping Policy spreadsheets that document these settings, and they are available on the Microsoft Download Center.
Note This is the tertiary blog in a series of Hey, Scripting Guy! Blogs that discuss using the Registry provider. The first blog, Use the PowerShell Registry Provider to Simplify Registry Admission,posted on Monday. Tuesday I discussed using the *restore* cmdlets to perform a organisation state fill-in of a computer prior to manipulating the registry. For additional information nigh working with the registry via Windows PowerShell, see this drove of blogs.
Creating new registry keys
Note The registry contains information that is vital to the functioning and configuration of your computer. Serious bug could ascend if yous edit the registry incorrectly. Therefore, it is important to back upwards your arrangement prior to attempting to make any changes. For information virtually backing up your registry, see commodity 322756 in the Microsoft Knowledge Base. For full general information almost working with the registry, see article 310516.
Creating a new registry key past using Windows PowerShell is the same equally creating a new file or a new folder. All three processes use the New-Item cmdlet. In addition, you lot might use the Test-Path cmdlet to make up one's mind if the registry key already exists. You may likewise wish to change your working location to one of the registry drives. If yous do this, you might employ the Push-Location, Set-Location, and Pop-Location cmdlets. This, of course, is the long manner of doing things…
Merely the steps:
- Store the current working location by using the Push-Location cmdlet.
- Change the current working location to the appropriate registry drive by using the Set-Location cmdlet.
- Use the Test-Path cmdlet to determine if the registry key already exists.
- Use the New-Item cmdlet to create the new registry key.
- Utilise the Pop-Location cmdlet to return to the starting working location.
The following example creates a new registry key named hsg off the HKEY_CURRENT_USERS software registry hive. It illustrates each of the previous five steps.
Button-Location
Gear up-Location HKCU:
Test-Path .\Software\hsg
New-Item -Path .\Software -Name hsg
Popular-Location
The commands and the associated output from the commands are shown in the prototype that follows.
The newly created registry key is shown here in the Registry Editor tool.
The short style to create a new registry key
It is not always necessary to change the working location to a registry drive when you create a new registry central. In fact, it is not even necessary to utilise the Test-Path cmdlet to make up one's mind if the registry key exists. If the registry key already exists, an fault generates. If y'all want to overwrite the registry key, use the Strength parameter.
Note How you choose to deal with an already existing registry central is one of those design decisions that confront IT Pros who venture far into the earth of scripting. Software developers are very familiar with these types of decisions, and they usually deal with them in the analyzing requirements portion of the development life bike. IT Pros who open up the Windows PowerShell ISE beginning, and think about the design requirements second, go easily stymied, or else write-in problems. For more information near this, see my Microsoft Press volume, Windows PowerShell two.0 Best Practices.
The following example creates a new registry key named hsg in the HKCU:\Software location. Because the command includes the total path, it does not need to execute from the HKCU bulldoze. Because the command uses the Force switched parameter, the command overwrites the HKCU:\Software\HSG registry key if information technology already exists.
New-Item -Path HKCU:\Software -Name hsg –Strength
Only the steps…
The shortcut manner to create a new registry key:
- Include the total path to the registry key to create.
- Utilize the Forcefulness parameter to overwrite whatsoever existing registry fundamental of the same proper name.
In the prototype that follows, the first attempt to create an hsg registry key fails because it already exists. The second command uses the Force parameter, which causes the control to overwrite the existing registry central. Therefore, information technology succeeds without creating an fault.
Setting the default value for the key
The previous examples do not set the default value for the newly created registry central. If the registry key already exists (as it does in this specific case), use the Set-Detail cmdlet to assign a default value to the registry key every bit follows.
Only the steps…
Assigning a default value to an existing registry fundamental:
- Employ the Prepare-Particular cmdlet and supply the complete path to the existing registry key.
- Supply the default value in the Value parameter of the Set-Item cmdlet.
The post-obit command assigns the value "hsg key" to the default property value of the hsg registry key that is contained in the HKCU:\Software location.
Set-Particular -Path HKCU:\Software\hsg -Value "hsg key"
The command does not return whatever data to the Windows PowerShell console when information technology runs. The modified registry key is shown hither in the Registry Editor tool.
Use New-Item to create and assign a value
Information technology is non necessary to apply the New-Item cmdlet to create a registry key and so to use the Gear up-Item cmdlet to assign a default value. These steps are combinable to a single control. The following command creates a new registry key with the proper noun hsg1, and it assigns a default value of "default value" to the registry primal.
New-Particular -Path HKCU:\Software\hsg1 -Value "default value"
The newly created registry central with default value is shown in the epitome that follows.
LL, that is all there is to creating a new registry key. Registry Week will go along tomorrow when I will talk near modifying registry keys by using Windows PowerShell.
I invite you to follow me on Twitter and Facebook. If you have any questions, send electronic mail to me at scripter@microsoft.com, or postal service your questions on the Official Scripting Guys Forum. See yous tomorrow. Until then, peace.
Ed Wilson, Microsoft Scripting Guy
What Does The Program Do Registers Custom Pkeys For Ie Registeriepkeys.exe,
Source: https://devblogs.microsoft.com/scripting/use-powershell-to-easily-create-new-registry-keys/
Posted by: seeberseetumbrave.blogspot.com

0 Response to "What Does The Program Do Registers Custom Pkeys For Ie Registeriepkeys.exe"
Post a Comment