优秀是一种习惯!!!
AmethystFOB   >   标签墙   >   脚本 标签

Bat常用脚本文件合集 有更新!

2023-11-29

Bat常用脚本文件合集 一、netstat -ano | findstr <端口号> taskkill /F /PID <进程ID> 使用上述两条命令在windows 10系统上强制关闭65425、65450、65401、65400、65500、65430这些端口 可以使用以下的bat文件脚本内容来强制关闭指定端口的进程: @echo off set ports=65425 65450 65401 65400 65500 65430 for %%p in (%ports%) do ( echo Killing processes on port %%p... for /f "tokens=5" %%a in ('netstat -ano ^| findstr "%%p"') do ( echo Taskkill /F /PID %%a taskkill /F /PID %%a ) ) echo All specified processes have been terminated. 将以上内容保存为一个扩展名为.bat的文件,然后在Windows 10系统上....