如何找到Windows中使用端口80的程序? [英] How do I find which program is using port 80 in Windows?
问题描述
如何找到Windows中使用端口80的程序?
How do I find which program is using port 80 in Windows?
我找不到它.
推荐答案
开始菜单→ 附件→右键单击命令提示符".在菜单中,单击以管理员身份运行" (在Windows XP上,您可以照常运行它),运行netstat -anb
,然后查看程序的输出.
Start menu → Accessories → right click on "Command prompt". In the menu, click "Run as Administrator" (on Windows XP you can just run it as usual), run netstat -anb
, and then look through output for your program.
顺便说一句,默认情况下,Skype尝试使用端口80和443进行传入连接.
BTW, Skype by default tries to use ports 80 and 443 for incoming connections.
您还可以先运行netstat -anb >%USERPROFILE%\ports.txt
,然后运行start %USERPROFILE%\ports.txt
,以在文本编辑器中打开端口和进程列表,您可以在其中搜索所需的信息.
You can also run netstat -anb >%USERPROFILE%\ports.txt
followed by start %USERPROFILE%\ports.txt
to open the port and process list in a text editor, where you can search for the information you want.
您还可以使用PowerShell解析netstat
输出并以更好的方式呈现(或以您想要的任何方式对其进行处理):
You can also use PowerShell to parse netstat
output and present it in a better way (or process it any way you want):
$proc = @{};
Get-Process | ForEach-Object { $proc.Add($_.Id, $_) };
netstat -aon | Select-String "\s*([^\s]+)\s+([^\s]+):([^\s]+)\s+([^\s]+):([^\s]+)\s+([^\s]+)?\s+([^\s]+)" | ForEach-Object {
$g = $_.Matches[0].Groups;
New-Object PSObject |
Add-Member @{ Protocol = $g[1].Value } -PassThru |
Add-Member @{ LocalAddress = $g[2].Value } -PassThru |
Add-Member @{ LocalPort = [int]$g[3].Value } -PassThru |
Add-Member @{ RemoteAddress = $g[4].Value } -PassThru |
Add-Member @{ RemotePort = $g[5].Value } -PassThru |
Add-Member @{ State = $g[6].Value } -PassThru |
Add-Member @{ PID = [int]$g[7].Value } -PassThru |
Add-Member @{ Process = $proc[[int]$g[7].Value] } -PassThru;
#} | Format-Table Protocol,LocalAddress,LocalPort,RemoteAddress,RemotePort,State -GroupBy @{Name='Process';Expression={$p=$_.Process;@{$True=$p.ProcessName; $False=$p.MainModule.FileName}[$p.MainModule -eq $Null] + ' PID: ' + $p.Id}} -AutoSize
} | Sort-Object PID | Out-GridView
而且它不需要高程即可运行.
Also it does not require elevation to run.
这篇关于如何找到Windows中使用端口80的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!