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

    Mapping a network drive when vpn client connects

    Scheduled Pinned Locked Moved OpenVPN
    6 Posts 3 Posters 1.4k 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.
    • H
      Heimire
      last edited by

      Trying to make the openvpn client map a network drive as part of the startup.

      Tried the a suggested method of making a batch file named "name of conifg_up.bat".
      In that batch file I call another batch file like this "start mapkdrive.bat"
      It runs the mapkdrive.bat file.
      Opens a dos window.
      maps the drive and the window stays open.
      In that window I can access the mapped drive.
      but outside that window I can't.
      The window is running as administrator.
      if I close the window the drive map is gone.

      Trying make this simple for some very simple minded users.
      Having a desktop icon that they can just click on and it runs the vpn client then map the drive would be fantastic.

      Did several searches but cant find anything that works.

      1 Reply Last reply Reply Quote 0
      • H
        heper
        last edited by

        The window is running as administrator.
        if I close the window the drive map is gone.

        that is the problem …. windows drive-maps are generally user-sensitive. a 'net use" running as administrator will not show up on the users 'my computer'.
        if you are running a AD/DC you could just use gpo's to map the drives. run a 'gpupdate /force' upon start of openvpn

        1 Reply Last reply Reply Quote 0
        • H
          Heimire
          last edited by

          Not running AD/DC.

          Any other suggestions?

          1 Reply Last reply Reply Quote 0
          • P
            phil.davis
            last edited by

            There is a Windows policy EnableLinkedConnections - that allows a normal user process and an elevated process to share drive letter mappings.
            But I suspect that in your case, the elevated process being an OpenVPN service thing and not an elevated copy of the user, that the mappings may not get shared anyway.

            As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
            If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

            1 Reply Last reply Reply Quote 0
            • H
              Heimire
              last edited by

              @phil.davis:

              There is a Windows policy EnableLinkedConnections - that allows a normal user process and an elevated process to share drive letter mappings.
              But I suspect that in your case, the elevated process being an OpenVPN service thing and not an elevated copy of the user, that the mappings may not get shared anyway.

              That seems to have worked.
              Did not test it much yet.

              Not a pretty way to do something very simple.

              1 Reply Last reply Reply Quote 0
              • P
                phil.davis
                last edited by

                It is a shame that Windows does not have a concept of adding a drive letter mapping for a share that is available system-wide ("net use /systemwide" command). It is happy to let an administrator define drive letters for the real partitions on the local disks, and those are seen by all users, so it couldn't be that difficult to allow the same for network shares.

                As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
                If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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