Quote:
Great, but what about the windows connection manager settings in "Settings 2"?
You're very perceptive. That page, which is a bit of a hack anyway, did not originally pass anything to openvpn.exe -- rather all of that stuff was done in the gui app. Basically, it's for trying to keep Windows Connection Manager from dropping the network connection when the TAP adapter comes up. It seems only necessary for phone-based network connections and unneeded for for wifi. At any rate, a couple releases ago I _did_ move that code into openvpn.exe itself, and added a command line option to control it. The option is 'conmgr'. You can see details in the sample config file that is installed called 'sample.ovpn'. In sum:
* presence of the option is like having 'Use Windows Connection Manager' checked.
* the second parameter, in quotes, is the name of the Connection to use, as shown in the list box of the UI. (It can also be the guid if you know it, and you generally won't)
* the last optional parameter is '1' or nothing at all, which corresponds to the 'Exclusive' check box.
Again, all this was intended as a hack but I never figured out a good way to make these choices automatically programatically.
Quote:
Hmm, I don't wonna code for WM5 (yet)
OK I understand but the event method is way easier that trying any telnet script stuff. Here is the program I have used:
Code:
#include "stdafx.h"
#include <windows.h>
int wmain(int argc, wchar_t* argv[])
{
wchar_t* pszName;
if ( argc < 2 )
{
pszName = L"openvpn_exit_1";
}
else
{
pszName = argv[1];
}
HANDLE h = CreateEvent ( NULL, TRUE, FALSE, pszName );
if ( NULL == h )
{
wprintf ( L"couldn't open event '%s'!\n", pszName );
return 2;
}
DWORD dwErr = GetLastError();
SetEvent ( h );
CloseHandle ( h );
return 0;
}
It takes the name of the even on the command line, and defaults to 'openvpn_exit_1' which is what the GUI defaults to, but you'll still need to specify that name on the command line to openvpn.exe with the --service option. If you don't want to compile it I can do it for you and post it on the web so you can download it. Then you can make the 'end vpn' shortcut you're wanting.
Edit: OK, I just uploaded that file to:
http://ovpnppc.ziggurat29.com/files/ovpnend.exeQuote:
Would be cool if you come up with a smartphone gui
May happen later this year. There have been a lot of requests for it, and with the fact that there are not that many pure PDAs any more, it has become more of a necessity. Still I am way too busy now, alas, and I don't have a device with which to test so I'd be flying blind.[url][/url][url][/url]