Openvpn maps shares



  • Hiya,

    Is it possble to get openvpn to map network shares as soon as it connects pls.

    I have home users and currently, I have a batch file that they need to click on after the connection is establish and I would like to automate all of this process.

    Cheers,

    Raj



  • If you use OpenVPN GUI on your clients, you can use the option to mount/dismount network maps automatically:

    Features in OpenVPN GUI:
      - Execute a batch file before/after connecting and before disconnecting.

    Just use connectionname_up.bat and connectionname_down.bat command scripts and they will run automatically at connect and disconnect.

    Example connectionname_up.bat:

    net use U: /DELETE /yes
    net use U: \\192.168.1.10\users
    

    Example connectionname_down.bat:

    net use U: /DELETE /yes
    


  • ok got it to work.

    The most important thing is to have the latest version on openvpn installed on the client.
    As then follow the instruction as per robi so create 2 bat files one connectionname_up and the other connectionname_down.

    Put these 2 files in the config directory of openvpn, where the certs and connectionnane.ovpn files are.

    ust use connectionname_up.bat and connectionname_down.bat command scripts and they will run automatically at connect and disconnect.

    Example connectionname_up.bat:
    Code:

    net use U: /DELETE /yes
    net use U: \192.168.1.10\users

    Example connectionname_down.bat:
    Code:

    net use U: /DELETE /yes

    Et voila job done.

    Thanks so much for your help robi and i hope  this can be of some help for someone else also

    Raj  :-)


Log in to reply