8

This is on a Windows Vista machine running IIS 7. Trying to start Default Web Site, but it says: "The process cannot access the file because it is being used by another process?

If I change binding to port 82, it works fine. So I guess something is running on 80. How do I find what it is?

splattne
  • 28,508
  • 20
  • 98
  • 148
epitka
  • 93
  • 1
  • 1
  • 4
  • If you are still having problem ... There is a second possible cause listed on the MS support page - " The ListenOnlyList registry subkey is not configured correctly on the computer that is running IIS. " Details here: http://support.microsoft.com/kb/890015 –  Sep 20 '09 at 02:01
  • Rebooted and problem went away :) –  Sep 20 '09 at 02:19

8 Answers8

10
netstat -ab | find ":80 "

Notice the space after 80. The /b requires an elevated command prompt.

EDIT: After close inspection, piping netstat -ab into find with that search string does not display the executable that the -b switch retrieves. This is because -b displays the owning process on a new line. =( I fail. But at least the first half of the command will work. I just had to get all fancy with the find command. =)

Wesley
  • 32,690
  • 9
  • 82
  • 117
4

The first thing I would do is open a browser to http://localhost/ and see what comes up... Then I'd check netstat of course.

Chris Nava
  • 1,147
  • 1
  • 7
  • 9
3

TCPView:

http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx

Greg Askew
  • 35,880
  • 5
  • 54
  • 82
3

I dont know on Vista but on XP you could:

netstat /a /b

on the console to check this.

Daniel
  • 131
  • 2
1

Start a command prompt as an administrator and run the command netstat -ab and find the appropriate line in the output. This should tell you the executable name of the process listening on that port.

Once you have that, there's a good chance you'll have an idea of what to look for, but if you're not sure what that executable file is, you can start Task Manager, go to the Processes tab, find the process in question, and right-click it and select Properties to get more info. If there are multiple processes with that name, run netstat -ao to get the process ID.

  • This was fastest way for me, so I accepted it. However I cannot see anything on port 80. Hmmm. –  Sep 20 '09 at 01:55
1

You can use NETSTAT -ADO to view ports in use, but unfortunately this doesn't give you the name of the application that opened a specific port. It does give you the process id, which you can use to zero in on the specific program in Task Manager.

Alternatively, you can download SysInternals' Tcpvcon program. When run, you'll see a full list of open ports as well as the programs which opened them.

David Andres
  • 156
  • 3
  • 1
    I don't know what you think -d might do but -o is more useful than -b as it displays the PID on the same line and doesn't require elevation. – Neil May 22 '12 at 08:53
0

Sysinternals - as mentioned in Dave's post (Sorry for the wrong info on my initial post)

or

http://www.howtonetworking.com/command/openport1.htm

Describes how to do this from the command line.

  • Portmon monitors and displays all serial and parallel port activity on a system, not network ports. –  Sep 20 '09 at 01:51
  • The tool you're linking to is for a very different kind of ports. You might have been thinking of TCPView (http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx), which is, for the most part, netstat in a GUI. –  Sep 20 '09 at 01:51
  • That is because I'm a complete idiot today. I remembered it was from the sysinternals suite and grabbed the first one from the search. Good catch- and sorry for the stupid. –  Sep 20 '09 at 01:54
0

The other answers will tell you what has port 80 open. But this might be System if port 80 has been opened by another application using HTTP.SYS (as IIS does1).

To see what is using HTTP.SYS to listen you can use (from an elevated command prompt):

netsh http show servicestate

(This gives a lot of information.)

Also HttpCfg.exe might work (from Windows XP SP2 Resource Kit).


1 This is why even if IIS is running on port 80 it does not show up as listening on port 80.

Richard
  • 5,324
  • 1
  • 23
  • 20