How can I force all traffic to go through OpenVPN connection

Solution 1:

Add redirect-gateway def1 option to the relevant VPN config file (C:\Program Files\OpenVPN\config\xxx.ovpn). You will need to run OpenVPN client with administrative rights.

You can also use it as a command-line argument like this: --redirect-gateway def1.

This will add a static route to the VPN service you use, remove your current default route and add a default route towards the VPN tunnel. Keep in mind, however, that this could lead to undesirable consequences, such as inability to access resources of your corporate network or your ISP DNS servers when the VPN connection is active. The former could be solved by adding additional static routes for your corporate network, the latter is resolved by using public DNS servers (e.g. Google's 8.8.8.8, 8.8.4.4).

There's some more useful information in documentation.