本文汇总了 Windows 常用的网络命令和进程管理命令。

📶 无线网络

查看无线网络配置

1
netsh wlan show profile

查看指定无线网络的密码

1
netsh wlan show profile name="无线网络名称" key=clear

无线网络名称 替换为实际的 WiFi 名称


🌐 公网 IP

获取公网 IP 地址

1
curl ipv4.icanhazip.com
1
curl httpbin.org/ip
1
curl ipconfig.io

🔌 端口管理

查看所有正在运行的端口

1
netstat -ano

查看指定端口

1
netstat -ano | findstr "端口号"

例如:netstat -ano | findstr 8080

根据端口号查找进程 PID

1
tasklist | findstr "端口号"

⚙️ 进程管理

查看所有运行中的任务

1
tasklist

根据 PID 结束进程

1
taskkill /F /PID "进程PID"

根据进程名结束进程

1
taskkill /F /IM "进程名称"

例如:taskkill /F /IM node.exe

结束进程树(强制结束)

1
taskkill /F /T /IM "进程名称"

📝 常用示例

场景 命令
查看 8080 端口被谁占用 netstat -ano | findstr 8080
结束占用 8080 端口的进程 taskkill /F /PID "上面查到的PID"
查看所有 Node.js 进程 tasklist | findstr node
强制结束 Chrome taskkill /F /IM chrome.exe