Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Openvpn maps shares

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    3 Posts 2 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rajbps
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • R
        robi
        last edited by

        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
        

        1 Reply Last reply Reply Quote 0
        • R
          rajbps
          last edited by

          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  :-)

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.