A convenient way to deal with "Unexpected Error 0x8ffe2740"

Ever had the annoying problem of IIS not wanting to start, coughing up the message "Unexpected Error 0x8ffe2740 Occurred."?  The reason is that some other application has grabbed port 80.  The most common applications doing this are Skype or Trillion.  You can try just ending task on them and see if IIS will then start.  If you're not running either of those then what could it be?  Microsoft's KB article about the subject describes using the third-party utilities TCPView or FPort.  But I think an easier way to find the issue is to simply drop out to a command prompt and run:

netstat -aon

Scroll up to the top part with TCP listings and you'll see something like this:

netstat aon

Then under "Local Address" look for 0.0.0.0:80.  This is your entry, and a the far right is the PID you're after.  With that number you can then run Task Manager, select the Process tab, and add the PID column in the display from View / Select Columns:

taskman pid

When you've found the process with the same PID, end task on it.  The universe should then return to a state of perfect harmony.  (Or at least your IIS will be able to start at that point!)

Another more geeky option to kill the offending app is to compile and run this line of .NET code:

System.Diagnostics.Process.GetProcessById( PID# ).Kill()

(Of course putting in the proper PID where indicated there.)

With everything that the Process class does, you could actually write your own highly effective Task Manager application in .NET if you really wanted to!

This article is part of the GWB Archives. Original Author: Lorin Thwaits

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.