Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Deleting registries

Posted on 2004-09-08
2
Medium Priority
?
199 Views
Last Modified: 2010-04-05
Hello,

Anyone can show me a code how to delete this registry :

   \HKEY_CURRENT_USER\Software\MyCompany\MyApplication\

Below ...\MyApplications\ there are some more keys and "folders" .

So after the deletion, the registry should be like this :

   \HKEY_CURRENT_USER\Software\MyCompany\

Thanks,
0
Comment
Question by:dudup
[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
2 Comments
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 12007268
use Registry

procedure TForm1.Button1Click(Sender: TObject);
var
  Reg: TRegistry;
begin
  Reg:=TRegistry.Create;
  try
      Reg.RootKey:=HKEY_CURRENT_USER; // Section to look for within the registry
      if not Reg.OpenKey('Software\MyCompany\MyApplication',False) then
        ShowMessage('Error opening key')
      else
        Reg.DeleteKey('Software\MyCompany\MyApplication\');
  finally
    Reg.Free;
  end;
end;
0
 
LVL 23

Accepted Solution

by:
Ferruccio Accalai earned 640 total points
ID: 12007312
mmm...

the correct syntax is the following

Reg:=TRegistry.Create;
  try
      Reg.RootKey:=HKEY_CURRENT_USER;
      if not Reg.OpenKey('\Software\MyCompany\MyApplication',False) then
        ShowMessage('Error opening key')
      else
        Reg.DeleteKey('\Software\MyCompany\MyApplication');
  finally
    Reg.Free;
  end;
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

610 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