[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

How to remove multiple registry keys using a batch file?

Asked by thehoff in Windows Batch Scripting, MS DOS, Miscellaneous Programming

Tags: Microsoft, Windows Server, 2003, REG commands

Hi,

I've searched around and found a few solutions for my problem using VBS, but I'd really like to avoid using that method if possible.

I need to remove a pile of separate registry keys (ie: they are not all part of the parent tree, they are all separate keys) that all contain the same word, for example:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ExpressServer.AssociatedIndex

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ExpressServer.Bookmark

etc. etc.

So I could go through the batch file like this:

REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ExpressServer.AssociatedIndex /va /f

REG DELETE HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ExpressServer.Bookmark /va /f

etc. etc.

however there are so many of these keys that I don't want to have to do it that way, plus I would be unsure if the uninstaller (that would have been run beforehand) would have removed exactly the same keys as the time before (this will be run many times on many servers).

I found a way to use REG QUERY to return the keys that I need:

REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ /f ExpressServer

however I cannot work out a way to nest this within the REG DELETE command - I'm quite sure it's not possible.

So how would I go about doing this?
Related Solutions: Batch file
[+][-]08/19/08 05:08 AM, ID: 22258997Accepted Solution

Your question has an Asker Certified™ answer! thehoff verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zones: Windows Batch Scripting, MS DOS, Miscellaneous Programming
Tags: Microsoft, Windows Server, 2003, REG commands
Sign Up Now!
Solution Provided By: knightEknight
Participating Experts: 3
Solution Grade: A
 
[+][-]08/19/08 05:11 AM, ID: 22259008Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/19/08 04:56 PM, ID: 22265012Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/08 05:41 PM, ID: 22265223Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/08 06:34 PM, ID: 22265405Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/19/08 06:52 PM, ID: 22265530Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/20/08 02:12 PM, ID: 22273981Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100315-EE-VQP-143 / EE_QW_2_20070628