Solved

Trying to use reg.exe to add multiple values under a key

Posted on 2008-10-01
2
1,442 Views
Last Modified: 2011-10-03
Hello Team,

I am trying to add a reg key and DWORD values via GPO.

Here is what I have:
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\ /v \\*\*\*\*.pst /t REG_DWORD

Works great for adding the one value:  \\*\*\*\*.pst  REG_DWORD (0)

But i want to add a few more values in one shot, notably.
\\*\*\*\*.pst
\\*\*\*\*.mdb
\\*\*\*\*.ldb
\\*\*\*\*.ost

Can someone rerite this for me, does have to be all the values, but just shot me how to have multuple values entered in a key in one command.

THANK YOU!
0
Comment
Question by:jaesoul
2 Comments
 
LVL 6

Accepted Solution

by:
DewFreak earned 500 total points
ID: 22619742
The reg.exe tool will not do what you want.  Just create a BAT file and enter:

REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\ /v \\*\*\*\*.pst /t REG_DWORD
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\ /v \\*\*\*\*.mdb /t REG_DWORD
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\ /v \\*\*\*\*.ldb /t REG_DWORD
REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\ /v \\*\*\*\*.ost /t REG_DWORD
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 22619908
Or setup a loop:

for %a in (pst mdb ldb ost) do REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\NetCache\ExclusionErrorSuppressionList\ /v \\*\*\*\%a /t REG_DWORD


use two %s if in a batch file..
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
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 …
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

792 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