Windows – Can’t install tap driver using tapinstall.exe for OpenVPN when run from a .bat file, but it works when running OpenVPN installer

openvpnvpnwindows 7

When I run

"..\bin\tapinstall.exe" install "..\driver\OemWin2k.inf" tap0901       

To add the tap driver, all I get back is a "failed" message with no details and the tap driver is not installed in Windows 7. The paths are correct and I tried specifying the absolute paths and it still didn't work. Running as an administrator also didn't fix the issue, however if I run the OpenVPN installer (latest version) and only select the tap driver, it is installed correctly.

I'm trying to make OpenVPN portable and the only thing standing in my way is installing the tap driver from a .bat file such as addtap.bat which comes from OpenVPN.

Best Answer

I had a similar problem, and googling around found some potential solutions.

The simplest is to check whether the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce (HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\RunOnce for Win 7 64 bit) registry key exists, and add it if it does not.

There is a registry problem which is related to using ESET Smart Security; you can find the description here.

The one that worked for me was dropping the OpenVPN-provided TAP driver altogether, and using http://openvpn.se/files/xp64/tap-win64.zip (Which is unsigned, so if you want it to work on Win7, you will need to sign it - here is a tutorial on how to self-sign it. I only needed it to work on my own machine so I just set tapistall.exe into Vista compatibility mode.)

Related Question