Solved

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

Posted on 2008-10-01
2
1,412 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

16 Experts available now in Live!

Get 1:1 Help Now