将需要启动的jar包放到相关目录下,我这边是 C:\Users\左右\Desktop\test。
编写 run.bat
@echo "执行app后台服务"
C:
cd C:\Users\左右\Desktop\test
java -jar disruptor-0.0.1-SNAPSHOT.jar --server.port=8666 > disruptor-0.txt
编写 run.vbs
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c C: & cd C:\Users\左右\Desktop\test & run.bat",0
将run.vbs快捷方式放到自启动目录下
C:\Users\左右\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
运行 run.vbs
双击 run.vbs 运行程序。