试了很多办法 最后只有这种办法比较简单实用
- 找到nacos安装路径 bin目录下 startup.cmd
- 右键编辑 设置为单机启动 set MODE = "standalone"
- 在nacos根目录下 创建nacosStartAuto.bat文件 编辑内容
@echo off E: CD E:\nacos\bin startup.cmd taskkill /f /im cmd.exe exit
- 打开cmd命令行 输入 shell:Common Startup
set ws=WScript.CreateObject("WScript.Shell")
ws.Run "E:\nacos\nacosStartAuto.bat",0
最后 重启电脑 访问nacoshttp://localhost:8848/nacos/index.html
试了很多种办法 这种办法还是比较实用 小伙伴们快去试一试吧