Solved

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

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

DevOps Toolchain Recommendations

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

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

785 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