Map Drives After Connecting
-
- OpenVpn Newbie
- Posts: 1
- Joined: Wed Oct 24, 2018 3:13 pm
Map Drives After Connecting
Perhaps I'm blind, but can someone point me in the direction to assist with finding out where to place batch files with commands to map drives after successfully connecting? I've seen some older articles but that's 7 years ago and I'm currently on version 2.5.x. I'm familiar with the process using netextender or anyconnect but w/OpenVPN is new to me. Appreciate any guidance
- Pippin
- Forum Team
- Posts: 1201
- Joined: Wed Jul 01, 2015 8:03 am
- Location: irc://irc.libera.chat:6697/openvpn
Re: Map Drives After Connecting
Make a batch, client_up.bat, adjust to your need:
Where client is the name of the config file.
Make another batch, down.bat:
Place both in config folder of OpenVPN.
Add to client.ovpn:
or
depending where your config file is.
Code: Select all
net use Y: \\192.168.160.1\share1 /user:username password
net use Z: \\192.168.160.1\share2
Make another batch, down.bat:
Code: Select all
net use /delete Y:
net use /delete Z:
Add to client.ovpn:
Code: Select all
script-security 2
down "c:\\Users\\<USERNAME>\\OpenVPN\\config\\down.bat"
Code: Select all
script-security 2
down "c:\\Program Files\\OpenVPN\\config\\down.bat"