Jump to content

How to remove registry keys


Recommended Posts

I have the following in a .reg file, and when importing it, nothing happens. Keys doesnt get removed. Which is what i want to do.

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\RTHDCPL]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SkyTel]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SoundMan]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\AlcWzrd]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Alcmtr]

thats the contents.

Now if i just:

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

Whole Run folder is removed, but it doesnt work to remove the individual keys therein.

I've tried some combinations, but geesh.. Help?

Edited by TranceEnergy
Link to comment
Share on other sites


Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\RTHDCPL]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SkyTel]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SoundMan]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\AlcWzrd]

[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Alcmtr]

You mean:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"RTHDCPL"=-
"SkyTel"=-
"SoundMan"=-
"AlcWzrd"=-
"Alcmtr"=-

?

I doubt they appear as you described them, or they wouldn't get executed anyway (except on win2000).

GL

Link to comment
Share on other sites

In registry terms:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] is a key

RTHDCPL is value

data is whatever was inside it

GL

Yes it makes sense when you say it like that, but it is not what i read MS describes it as. Alas MS fails to describe it properly but you do not.

Thanks once again, also for making this observation.

Link to comment
Share on other sites

Alas MS fails to describe it properly...

Actually, Microsoft did explain it to you in plain English and quite clearly I might add.

Syntax of .Reg Files

A .reg file has the following syntax:

RegistryEditorVersion

Blank line

[RegistryPath1]

"DataItemName1"="DataType1:DataValue1"

DataItemName2"="DataType2:DataValue2"

Blank line

[RegistryPath2]

"DataItemName3"="DataType3:DataValue3"

They also very nicely explain exactly how to delete registry values:

Deleting Registry Keys and Values

To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:

HKEY_LOCAL_MACHINE\Software

put a hyphen in front of the following registry key in the .reg file:

HKEY_LOCAL_MACHINE\Software\Test

The following example has a .reg file that can perform this task.

[-HKEY_LOCAL_MACHINE\Software\Test]

To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:

HKEY_LOCAL_MACHINE\Software\Test

put a hyphen after the "TestValue"= in the .reg file. The following example has a .reg file that can perform this task.

HKEY_LOCAL_MACHINE\Software\Test

"TestValue"=-

To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.

Both of those quotes come directly from the MSKB that you linked. :)

Now for what you want to do, it's be exactly as GrofLuigi has said. Let's say you have a test application that you want to stop from starting up with the computer for every user account. You would put this into your .reg file:

Windows Registry Editor Version 5.00 = Windows 2000 and up

REGEDIT4 = Windows Me and below.

So since you're working with Windows XP Pro x64, you would have:

Windows Registry Editor Version 5.00

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
"MyStartupApp"=-

I would advise that you slow down and read through things thoroughly before jumping into things. When you edit the registry without knowing what you are doing, there is a great potential to cause problems.

If anyone is unfamiliar with the registry, it's best to leave it alone.

Link to comment
Share on other sites

Alas MS fails to describe it properly...

Actually, Microsoft did explain it to you in plain English and quite clearly I might add.

Syntax of .Reg Files

A .reg file has the following syntax:

RegistryEditorVersion

Blank line

[RegistryPath1]

"DataItemName1"="DataType1:DataValue1"

DataItemName2"="DataType2:DataValue2"

Blank line

[RegistryPath2]

"DataItemName3"="DataType3:DataValue3"

They also very nicely explain exactly how to delete registry values:

Deleting Registry Keys and Values

To delete a registry key with a .reg file, put a hyphen (-) in front of the RegistryPath in the .reg file. For example, to delete the Test subkey from the following registry key:

HKEY_LOCAL_MACHINE\Software

put a hyphen in front of the following registry key in the .reg file:

HKEY_LOCAL_MACHINE\Software\Test

The following example has a .reg file that can perform this task.

[-HKEY_LOCAL_MACHINE\Software\Test]

To delete a registry value with a .reg file, put a hyphen (-) after the equals sign following the DataItemName in the .reg file. For example, to delete the TestValue registry value from the following registry key:

HKEY_LOCAL_MACHINE\Software\Test

put a hyphen after the "TestValue"= in the .reg file. The following example has a .reg file that can perform this task.

HKEY_LOCAL_MACHINE\Software\Test

"TestValue"=-

To create the .reg file, use Regedit.exe to export the registry key that you want to delete, and then use Notepad to edit the .reg file and insert the hyphen.

Both of those quotes come directly from the MSKB that you linked. :)

Now for what you want to do, it's be exactly as GrofLuigi has said. Let's say you have a test application that you want to stop from starting up with the computer for every user account. You would put this into your .reg file:

Windows Registry Editor Version 5.00 = Windows 2000 and up

REGEDIT4 = Windows Me and below.

So since you're working with Windows XP Pro x64, you would have:

Windows Registry Editor Version 5.00

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
"MyStartupApp"=-

I would advise that you slow down and read through things thoroughly before jumping into things. When you edit the registry without knowing what you are doing, there is a great potential to cause problems.

If anyone is unfamiliar with the registry, it's best to leave it alone.

You can put it however you like, english is not my native language, and at the end of the day, nothing in the link said to me that look, this is the syntax this is what this is and thats that. GL explained it in a single sentence, and that's all there is to it. A good example of kiss in effect imho.

If you look at what i thought was right, and try to understand my pov, you would see it then made sense, even that i did know it was wrong.(why i posted in the first place)I simply tried what the ms article said in what way i understood it. Why slow down? Life's too short.

Link to comment
Share on other sites

I completely understood where you were coming from. Just letting you know that Microsoft is not to blame; all of the information one would need is present in that article, and it is detailed quite nicely. :)

Btw, you do an excellent job with the English language.

Link to comment
Share on other sites

I completely understood where you were coming from. Just letting you know that Microsoft is not to blame; all of the information one would need is present in that article, and it is detailed quite nicely. :)

Btw, you do an excellent job with the English language.

Thank you very much. The problem often is that while some things may seem foolproof in one's native tongue, doesnt make it so if you're not accustomed to *think* in that language.

Reading and writing isn't everything. I actually still didnt quite understand it, but as long as i know how to do it, then that will do just fine.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...