?
Solved

Deleting registries

Posted on 2004-09-08
2
Medium Priority
?
195 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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