原文链接: https://github.com/v2ray/v2ray-core/issues/452
start_v2ray.bat
@echo off
rem 2017/4/23 编写
rem 启动v2ray程序脚本
rem %~d0:获取当前盘符
rem %~dp0:获取当前盘符和路径
rem %~sdp0:当前盘符和路径文件名格式
rem %~f0:当前批处理的全路径
rem %cd%:当期CMD默认目录
title v2ray启动程序
color 0a
start "v2ray" "%~dp0\wv2ray.exe"
rem 查找进程
rem tasklist|findstr "wv2ray.exe"
tasklist /fi "imagename eq wv2ray.exe"
echo.
echo.
echo 已启动v2ray程序
echo.
pause
stop_v2ray.bat
@echo off
rem 2017/4/23 编写
rem 关闭wv2ray的批处理命令。
rem stop
title v2ray退出程序
color 0a
rem 查找完整进程名
echo.
tasklist|findstr "wv2ray.exe"
echo.
taskkill /f /im wv2ray.exe
rem if "%errorlevel%"==0
echo.
IF ERRORLEVEL 1 goto 1
IF ERRORLEVEL 0 goto 0
Rem 上面的两行不可交换位置,否则失败了也显示成功。
:0
echo 命令执行成功,已关闭v2ray程序!
Rem 程序执行完毕跳至标题exit处退出
goto exit
:1
echo 命令执行失败,该进程不存在或当前不在运行状态!
Rem 程序执行完毕跳至标题exit处退出
goto exit
:exit
echo.
pause
config.json
{
"log" : {
"access": "C:\\Program Files\\v2ray\\access.log",
"error": "C:\\Program Files\\v2ray\\error.log",
"loglevel": "warning"
},
"inbound": {
"port": 10086,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "23ad6b10-8d1a-40f7-8ad0-e3e35cd38297",
"level": 1,
"alterId": 64
}
]
}
},
"outbound": {
"protocol": "freedom",
"settings": {}
},
"outboundDetour": [
{
"protocol": "blackhole",
"settings": {},
"tag": "blocked"
}
],
"routing": {
"strategy": "rules",
"settings": {
"rules": [
{
"type": "field",
"ip": [
"0.0.0.0/8",
"10.0.0.0/8",
"100.64.0.0/10",
"127.0.0.0/8",
"169.254.0.0/16",
"172.16.0.0/12",
"192.0.0.0/24",
"192.0.2.0/24",
"192.168.0.0/16",
"198.18.0.0/15",
"198.51.100.0/24",
"203.0.113.0/24",
"::1/128",
"fc00::/7",
"fe80::/10"
],
"outboundTag": "blocked"
}
]
}
}
}
文章评论