Skip to content

Instantly share code, notes, and snippets.

@howiezhao
Last active September 18, 2018 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howiezhao/56b54a8b590715f1a993d1d63392d928 to your computer and use it in GitHub Desktop.
Save howiezhao/56b54a8b590715f1a993d1d63392d928 to your computer and use it in GitHub Desktop.
Windows下启动kcptun客户端脚本
Dim RunKcptun
Set fso = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
'获取文件路径
currentPath = fso.GetFile(Wscript.ScriptFullName).ParentFolder.Path & "\"
'软件运行参数
exeConfig = "client_windows_amd64.exe -l :12300 -r 45.78.23.85:5000 -key 1072841047 -mtu 1400 -sndwnd 256 -rcvwnd 2048 -mode fast2 -dscp 46"
'日志文件
logFile = "kcptun8486.log"
'拼接命令行
cmdLine = "cmd /c " & currentPath & exeConfig & " > " & currentPath & logFile & " 2>&1"
'启动软件
WshShell.Run cmdLine, 0, False
'等待1秒
'WScript.Sleep 1000
'打印运行命令
'Wscript.echo cmdLine
Set WshShell = Nothing
Set fso = Nothing
'退出脚本
WScript.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment