Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

delete a registry key with batch?

Original Message
Name: Ian
Date: October 14, 2003 at 07:33:20 Pacific
Subject: delete a registry key with batch?
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

Report Offensive Message For Removal


Response Number 1
Name: SN
Date: October 14, 2003 at 08:04:48 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
This question is asked surprisingly often.

Here are some similar questions:
http://computing.net/programming/wwwboard/forum/4321.html

http://computing.net/programming/wwwboard/forum/3054.html

http://computing.net/programming/wwwboard/forum/6834.html


Report Offensive Follow Up For Removal

Response Number 2
Name: Ian
Date: October 14, 2003 at 08:44:28 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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.

Report Offensive Follow Up For Removal

Response Number 3
Name: SN
Date: October 14, 2003 at 08:56:25 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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?


Report Offensive Follow Up For Removal

Response Number 4
Name: Ian
Date: October 14, 2003 at 09:03:40 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 5
Name: SN
Date: October 14, 2003 at 09:28:30 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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.


Report Offensive Follow Up For Removal


Response Number 6
Name: mesich
Date: October 14, 2003 at 09:33:32 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 7
Name: Ian
Date: October 14, 2003 at 10:13:34 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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.

Report Offensive Follow Up For Removal

Response Number 8
Name: SN
Date: October 14, 2003 at 18:46:51 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 9
Name: Dr. Nick
Date: October 15, 2003 at 00:12:32 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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


Report Offensive Follow Up For Removal

Response Number 10
Name: JackG
Date: October 15, 2003 at 14:39:57 Pacific
Subject: delete a registry key with batch?
Reply: (edit)
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.



Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: delete a registry key with batch?

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




how to setup call of duty to joytok

WindowsME / HotMail Problem

Corrupt memory

Convert fat32 to Ntfs

Best WinMo phone of 2008


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC