windows后台启动bat、frp等程序
用vb启动,以frpc为例
set ws=wscript.createobject("wscript.shell") ws.run "cmd /c d:\sdn\frpc.exe -c d:\sdn\frpc.ini",0
将上面的代码保存为vbs文件,双击运行即可,任务管理器就可以看到frpc进程了
如果要开机自动运行,就将vbs文件拷贝到 C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp windows启动目录存放即可
frpc.ini 配置文件
[common] server_addr = 190.160.234.222 server_port = 470 token = xJ1ad #log_file = /var/log/frpc.log #og_level = info tls_enable = true [rdp3389] type = tcp local_ip = 127.0.0.1 local_port = 3389 remote_port = 3389
frpc.service
[Unit] Description=frpc After=network.target Wants=network.target [Service] Restart=on-failure RestartSec=5 ExecStart=/usr/local/frc/frpc -c /usr/local/frc/frpc.ini [Install] WantedBy=multi-user.target