不希望总是通过windows命令行手动启动frpc或者npc?亦或者希望设置开机自启?
当然没问题!可以编写windows的bat脚本,直接手动启动或者开机自启动!
1. 编写bat脚本
![图片[1]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403171732254-image-1024x565.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
![图片[2]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403171833732-image-1024x447.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
![图片[3]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403172442258-image-1024x659.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
![图片[4]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403172730738-image-1024x584.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
@echo off
cd /d D:\App\frp_0.61.0_windows_amd64
frpc.exe -c frpc.toml
![图片[5]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403173123539-image.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
然后创建bat脚本的桌面快捷键,在桌面即可打开
![图片[6]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403183451214-image-1024x710.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
![图片[7]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403183549251-image-1024x576.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
2. 开启自启动
Win + r,然后输入:
shell:startup
或者输入:
shell:common startup
以上两种方式任选其一即可
![图片[8]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403183153181-image-1024x292.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
输入之后回车,然后进入启动目录
然后将桌面的快捷启动方式复制到该启动目录即可,后续电脑重启就会自动启动该服务啦!
![图片[9]-Windows bat脚本快速启动或者开机自启内网穿透服务frpc或者npc服务!](https://cos.soyisou.cn/wp-content/uploads/2025/04/20250403183642120-image-1024x635.png?watermark/2/text/6ZOt6L2p57K-6YCJCkFjSmF2YQp3d3cuYWNqYXZhLmNvbQ/font/dGFob21hLnR0Zg/fontsize/24/fill/IzAwMDAwMA/dissolve/73/shadow/0/gravity/southeast/dx/20/dy/20)
AcJava,让技术学习更简单!
我是铭轩,微信:ac_java,欢迎与我随时交流!
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容