Computing.Net > Forums > Programming > delete a registry key with batch?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

delete a registry key with batch?

Reply to Message Icon

Name: Ian
Date: October 14, 2003 at 07:33:20 Pacific
OS: any
CPU/Ram: any
Comment:

can someone show me a very simple sample of a batch command that will delete a specific registry entry. thnx alot! I need it to automate the deletetion of a program. Im not a great dos user,im fair tho, so please dont make it all complex. :p thnx again



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: October 14, 2003 at 08:04:48 Pacific

Response Number 2
Name: Ian
Date: October 14, 2003 at 08:44:28 Pacific
Reply:

You wasted all that time finding and posting 3 msg's that airnt even what i asked. I asked for a sample code for REMOVING a reg key. not to add one, not to use the command reg edit. maybe if i say it slower and in BIG shiny letters youll understand...I WANT TO DELETE A SPECIFIC REGISTRY KEY AND AUTOMATE IT USING BATCH. CAN YOU SHOW ME A SAMPLE CODE THAT WILL DELETE A REGISTRY KEY.


0

Response Number 3
Name: SN
Date: October 14, 2003 at 08:56:25 Pacific
Reply:

Ian-
Bless your heart, I don't think you really read any of those three links...These words sound familiar?

"This is minimally what a registry-entry-deleting .inf file needs: " (2nd link)

The third link says that you can use the "reg" command from dos with parameters to modify the registry in different ways. Whether this is true or not I don't know, but if it is, then it could be used in a DOS batch file to do what you want.

The first link shows how to import an entire .reg file into the registry...I thought the pertinent part was the switch that suppressed the confirmation dialog.

You will, hopefully, accept my profound apologies for trying to help. It won't happen again.

Yours truly,
-SN
P.S. I didn't see any extra shine on those letters...Are you sure you made them big AND shiny?


0

Response Number 4
Name: Ian
Date: October 14, 2003 at 09:03:40 Pacific
Reply:

Thnx for the reply, it was just as helpful as the first one. Please feel free to post as many usless replies as possible, as they are VERY helpful in fixing my problem. im not sure you understand the point of a forum so i will break it down for you. pay attention. ok, someone posts there problem, then someone who is KNOWLEDGABLE will post a reply helping to solve the problem ( this where you got confused, you dont just post random posts that have nothing to do with the subject matter) then the person will read that reply and be able to fix their problem. i hope this is helpful in teaching you the basics of how a form works, this way in the future you won't waste other peoples time


0

Response Number 5
Name: SN
Date: October 14, 2003 at 09:28:30 Pacific
Reply:

Ian-
Okay little man, this will be my last reply. Using ONLY the information given in the second link, it took me just under 5 minutes to write a batch file that deleted a key from my registry.

Now, I'm torn. I'll tell you why. I don't want to help you because you're an ungrateful little punk who needs a lesson in NOT BEING AN IDIOT. At the same time, I want to show you that you ARE an idiot by posting exactly the code I used, so you can see that both my replies were actually quite helpful and that you're a snotnosed child that would rather make fun of somebody rather than accept their help, even when you asked for it.

Well, I've made my decision. I'm going to post my code, so that way each time you run this batch file you'll remember me and think "Boy that SN guy really was a good person, I don't know why I was such a moron in those days. But then again, I was also a really bad speller." I think that will give me more satisfaction than you not having the solution at all.

So here it is:
in the file "c:\windows\desktop\test.inf", I put in the following:
[version]
signature = "$CHICAGO$"

[DefaultInstall]
DelReg = NoParasites

[NoParasites]
HKLM,"Software\Microsoft\Windows\CurrentVersion\Run","TKBellExe"

TKBellExe is the name of the key I wanted to delete.

I then looked in the registry key mentioned in the second link to see how .inf files are installed from dos. Using that command, I put the following in a batch file:

c:\windows\rundll.exe setupx.dll,InstallHinfSection DefaultInstall 132 c:\windows\desktop\test.inf

I then ran the batch file, (you do that by double clicking it...In case that was where you got hung up)

Again, this was all done using only the information in the second link. The first and third were just gravy in case you needed something else.

Now go run off and follow my instructions exactly. And don't forget to grow up.

-SN
P.S. Credit is due Jeff J for figuring all this out. All I did was copy and paste.


0

Related Posts

See More



Response Number 6
Name: mesich
Date: October 14, 2003 at 09:33:32 Pacific
Reply:

Hi everyone,

SN,

I was able to create a batch file to delete a registry entry using the links you provided.

Ian,

I believe SN does understand the point of a forum, I also believe you do not understand how to conduct yourself properly in order to receive the answer to your question.

By the way, SN is extremely knowledgable.

Mesich


0

Response Number 7
Name: Ian
Date: October 14, 2003 at 10:13:34 Pacific
Reply:

Ok, thank you very much for your help. That was exactly what I needed. I apologize for being so rude, I have been manually deleting annoying reg keys all day and this was very helpful. Your right I didnt read the posts you had throughly enough because the answer was there in front of me the whole time. Once again, thank you for your assistance and I apologize for my rudeness and ignorance. If you would like SN I will place an echo request in the batch stating credit to SN.


0

Response Number 8
Name: SN
Date: October 14, 2003 at 18:46:51 Pacific
Reply:

Ian-
I appreciate the thanks and the apology. As I didn't do anything original, and what I did do was pretty short, there is no need to put me in the batch file anywhere.

No hard feelings,
-SN


0

Response Number 9
Name: Dr. Nick
Date: October 15, 2003 at 00:12:32 Pacific
Reply:

Hehe, I needed a laugh. Gotta love posts like this, although usually the original poster doesn't come around. Hurray for Ian for seeing the light and to SN for his good attitude.

Just in case anyone ever comes looking or is interested, you can do some very cool stuff with INF files. Here's a link to just about all of it.

http://www.leeos.com/infdoc.html


0

Response Number 10
Name: JackG
Date: October 15, 2003 at 14:39:57 Pacific
Reply:

But, I protest. The FIRST method in Response 1 has almost all of the information for doing what is needed to delete known Registry entries. And does not have to resort to INF's.

Any *.REG file execution that can add Registry entries can also delete Registry entries.

Insert a "-" (minus) after the opening "[" and the entry becomes a delete command.

[HKEY.....].... adds an entry

[-HKEY.....]..... deletes an entry

This allows the same *.REG file to first remove old entries and then add new entries. One could create such a *.REG file, place it on a diskette or a server and then use Explorer on each system to open and update that system.



0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: delete a registry key with batch?

~ BATCH: Find & delete a reg key ~ www.computing.net/answers/programming/-batch-find-amp-delete-a-reg-key-/9750.html

del a reg key value with batch www.computing.net/answers/programming/del-a-reg-key-value-with-batch/9246.html

Help me delete a reg key with batch www.computing.net/answers/programming/help-me-delete-a-reg-key-with-batch/8474.html