@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begin在这下面再去执行你自定义的bat命令
@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:beginjava -jar rocketmq-console-ng-1.0.1.jar
@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begin.\mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true
@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begin./mqnamesrv.cmd
@echo offif "%1" == "h" goto beginmshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit:begin.\startup.cmd -m standalone
windows根据端口号杀掉进程脚本
@echo offset port=20002for f "tokens=5" %%a in ('netstat /ano | findstr %port%') do taskkill /F /pid %%a//for循环,提取第5个字段(从命令的结果中)赋予到变量a,并执行杀进程调用变量apause
上面那个脚本文件中端口号写死了,可以提取出来当成参数传递
@echo offset port=%1for /f "tokens=5" %%a in ('netstat /ano | findstr %port%') do taskkill /F /pid %%a//for循环,提取第5个字段(从命令的结果中)赋予到变量a,并执行杀进程调用变量apause
文章转载自IT学习道场,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




