I work in a bunch of tools that do things to customer's computers. Some of these tools allow scripting, which allows someone to run a script to nuke files, registry keys, or the like. Of course, if the script is bad, or if there's a serious bug in the tool, it could cause damage to the person's system. I'm concerned that a user might become... angry... with me if something goes wrong.

How do I minimize the likelihood of being sued as a result of publishing such a tool?

If you're at all worried about this, consult a lawyer and ask. You should be able to get a low-cost initial consultation through your local Bar Association (you're in the US). This is not a crystal-clear legal situation, and random programmers on the Internet are no substitute for lawyers in this case.
–
David ThornleyOct 21 '11 at 18:11

Does that prevent lawsuits? No. But it's ammunition for your defense lawyer should it come to that.

Of course, IF your software is the explicit CAUSE of any damage, then no disclaimer will probably help you.

In the US, you can't really prevent lawsuits in this happy litigation society, but you can prevent some of the damage by setting up a corporation-- this will prevent (in most cases) any lawsuits against your personal assets.

To add my own disclaimer: I am not a lawyer, seek professional council, yada-yada-yada.

I think some programs come with blanket disclaimers that say the developer is not responsible for anything bad that happens under any circumstances as a result of using the software, whether it's the user's fault or the software developer's bug's fault.
–
FrustratedWithFormsDesignerOct 21 '11 at 17:08

Crowley (a demon) had been extremely impressed with the licences offered by the computer industry, and sent a bundle 'Below' to the Immortal Soul agreements department , with a note just saying: "Learn, guys." (Good Omens, Terry Pratchett, Neal Gaiman)
–
Martin BeckettOct 25 '11 at 15:53

If you are in the USA there is a 100% chance you will be sued by somebody, it's just part of doing business. It doesn't mean they will be successful or even have a chance - but just like Typhoons in SE Asia, snow in Scandinavia or rain in Seattle, it comes with the territory.

There is nothing you can do to prevent getting sued. My company is getting sued right now despite a diamond solid TOS, Disclaimer, and EULA.

They know they won't win, but then winning in court is not the goal sometimes. If your product is so good that it embarrasses a well established corporation with a mediocre product and 80% market share, and then this corporation will either offer to buy out your company or sue you just trying to force you to pay lots of money for legal fees defending yourself. Or both just to drive their point home.

Form an LLC, keep its assets low and liabilities high and you should be safe personally.