网络编程
位置:首页>> 网络编程>> Python编程>> 查看端口并杀进程python脚本代码

查看端口并杀进程python脚本代码

作者:admin' or 1=1  发布时间:2022-06-26 21:58:32 

标签:端口,杀进程,python

我就废话不多说,直接上代码吧:


# -*- coding: utf-8 -*-
import os
out=os.system('netstat -aon|findstr "25"')#25端口号
print(out)#输出进程
out=os.system('tasklist|findstr "3316"')#3316进是程
print(out)#输出程序名字
out=os.system('taskkill /f /t /im MESMTPC.exe')#MESMTPC.exe程序名字
print(out)#

依次手动执行每个命令

来源:https://blog.csdn.net/u013187790/article/details/80700951

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com