1.查询端口 这里以445端口为例 netstat -ano | findstr "445" 2.查询端口名 tasklist | findstr "4" 这个端口名也就是第1步查询结果最后一列的数字 3.关闭端口 taskkill /pid "445" /F 这里的 /F是强制关闭的意思