?
Solved

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

Posted on 2008-10-01
2
Medium Priority
?
1,509 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 6

Accepted Solution

by:
DewFreak earned 1500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

762 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