vbs快速入门-程序解说

'定义变量
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 :12948 -r 45.176.171.148:29999 -key fffmo.com -mtu 1400 -sndwnd 256 -rcvwnd 2048 -mode fast2 -dscp 46"

'日志文件
logFile = "kcptun.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
'运行其它
Dim objws 
Set objws=WScript.CreateObject("wscript.shell") 
'objws.Run "D:\ls\122.114.59.236\风暴\vpn\ss\Shadowsocks.exe",,True 
objws.Run "D:\ls\122.114.59.236\风暴\vpn\ss\Shadowsocks.exe"
'退出脚本
WScript.quit
赞(2) 打赏
特别声明:除特殊标注,本站文章均为原创,遵循CC BY-NC 3.0,转载请注明出处。三伏磨 » vbs快速入门-程序解说

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏