I'm sorry but that didn't work. Apparently openconnect spawned it's own cscript.exe on my batfle hack. CSTP connected. DPD 90, Keepalive 0 CSTP Ciphersuite: (TLS1.0)-(RSA)-(3DES-CBC)-(SHA1) Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Input Error: There is no script engine for file extension ".bat". Opened tun device My-TAP TAP-Windows driver v9.21 (0) Microsoft (R) Windows Script Host Version 5.8 Copyright (C) Microsoft Corporation. All rights reserved. Input Error: There is no script engine for file extension ".bat". -----Original Message----- From: David Woodhouse Sent: Friday, January 30, 2015 10:43 AM To: Steven Petraglia Cc: Niels Peen ; openconnect-devel at lists.infradead.org Subject: Re: Question About vpnc-script-win.js On Fri, 2015-01-30 at 08:31 -0500, Steven Petraglia wrote: > > ::-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > :: Windows7 Run From Current Dir > ::-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- > pushd %~dp0 > > set VERBOSE=-v > > set CISCO_SPLIT_INC=2 > set CISCO_SPLIT_INC_0_ADDR = "20.137.0.0" > set CISCO_SPLIT_INC_0_MASK = "255.255.0.0" > set CISCO_SPLIT_INC_0_MASKLEN = "32" > set CISCO_SPLIT_INC_1_ADDR = "170.225.31.0" > set CISCO_SPLIT_INC_1_MASK = "255.255.255.0" > set CISCO_SPLIT_INC_1_MASKLEN = "32" > > "openconnect.exe" %VERBOSE% client.com Hah, so *this* is why OpenConnect was crashing. It tries to set these environment variables according to what the server tells us, and the bug triggered when it found them already set (I'd coded it to delete existing conflicting variables from the environment but evidently not tested it very well). You need to interpose your script between openconnect and vpnc-script-win.js, not run it before openconnect. So run openconnect with '--script routehack.bat', and change routehack.bat so that it sets those variables and then invokes vpnc-script-win.js. Although I think openconnect expects its script to be run with 'cscript.exe' so perhaps it needs to be JavaScript instead of a batch file. -- dwmw2