作者:高俊伦丽成 | 来源:互联网 | 2023-08-07 20:01
netstat--help#获取帮助netstat-anc:\aaa.txt#将显示的结果输入到C盘aaa.txt文件中netstat-ano|find“443”#查看443端口@echooffnetstat
![Windows使用正则表达式查看端口](https://img1.php1.cn/3cd4a/24c6f/711/1817132772db5b74.jpeg)
netstat --help#获取帮助
netstat -an > c:\aaa.txt #将显示的结果输入到C盘aaa.txt文件中
netstat -ano | find “443”#查看443端口
![Windows使用正则表达式查看端口](https://img1.php1.cn/3cd4a/24c6f/711/99a0f924b47ec094.jpeg)
@echo off
netstat -an > c:\t.txt #在C盘创建文件名为t.txt
type c:\t.txt | find ":21" > tmp.txt && echo "ftp is running...."
type c:\t.txt | find ":80" > tmp.txt && echo "http is running...."
pause
type c:\t.txt | find ":123" > tmp.txt && echo "hehe is running...."
pause
del c:\t.txt
::这是我试验用于检测各项服务是否开启