How to delete a registry key in Command Line

By jhazard112 ·
I have been trying to find out how to delete a registry key in command line within XP. I found a way to do it in 2000, but nothing for XP. This is the command that I am using:

regedit /del HKLM\software\microsoft\windows\currentversion\run\"Adobe Reader Speed Launcher" /force

I run it and nothing happpens. It does not delete the key. I am trying to make this a batch, so that I can run this everytime I reload a computer. This is not the exact file that I need to delete but it is a good test.

Along with that, I have to open command line with admin rights to do anything obviously. But I was wondering if there was a way to make a batch that will open command line with admin rights. I have to do a runas in Start>Run to do this. Any help is much appreciated.

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

Registry deletes

by christianshiflet In reply to How to delete a registry ...

Okay, first I would create a reg file or a batch file to remove your registry key and test it to make sure it works as a local administrator. Reg file help here: As for regedit, try using the reg command (

Once that is done, create a vb script to run the file as an administrator ( I use this technique to create install files so I don't have to elevate a user's rights or log on as an admin to install stuff. It works quite well. You can also encode the script so that people can't easily edit or read through the script if it is accessible to users using windows script encoder. Mind the warning, however, as the encoding is not super secure. It is really just a deterrent.

I hope this helps. Let me know if you have questions. Thanks.

Related Discussions

Related Forums