Help - Search - Members - Calendar
Full Version: How to remove registry keys
MSFN Forums > Microsoft Software Products - Discussion & Support > Windows XP > Windows XP 64 Bit Edition

   
Google Internet Forums Unattended CD/DVD Guide
TranceEnergy
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?
GrofLuigi
QUOTE (TranceEnergy @ Jun 7 2008, 07:46 PM) *
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:

CODE
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
TranceEnergy
Ok now im confused, because that works. According to what i read at http://support.microsoft.com/kb/310516
"How to add, modify, or delete registry subkeys and values by using a registration entries (.reg) file"
That would just erase the content of the registry keys, not the keys themselves.

Thank you so much =)
GrofLuigi
In registry terms:

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

RTHDCPL is value

data is whatever was inside it

GL
TranceEnergy
QUOTE (GrofLuigi @ Jun 8 2008, 05:38 AM) *
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.
Tarun
QUOTE (TranceEnergy @ Jun 8 2008, 11:48 AM) *
Alas MS fails to describe it properly...

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

QUOTE (MSKB 310516)
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:

QUOTE (MSKB 310516)
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. smile.gif

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:

CODE
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.
TranceEnergy
QUOTE (Tarun @ Jun 9 2008, 07:36 PM) *
QUOTE (TranceEnergy @ Jun 8 2008, 11:48 AM) *
Alas MS fails to describe it properly...

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

QUOTE (MSKB 310516)
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:

QUOTE (MSKB 310516)
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. smile.gif

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:

CODE
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.
Tarun
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. smile.gif

Btw, you do an excellent job with the English language.
TranceEnergy
QUOTE (Tarun @ Jun 10 2008, 01:44 AM) *
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. smile.gif

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.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.