Announcement

Collapse
No announcement yet.

Force Mapped Drives to appear in "Computer"

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Force Mapped Drives to appear in "Computer"

    Hi,
    Trying to solve a bigger issue with smaller steps...

    If I add a mapped drive using "persistent:yes" then obviouly the drives will appear in My Computer when the PC starts, either as working drives if the server is available, or as unavailable drives with a red cross on them if the server is not available. However I dont want them to be persistent I want them to connect as a script.

    However if i use a batch script with the following;
    net use p: \\server\pdriveshare
    when "Server" isnt contactable it just fails to map a drive;

    What I need is a way of scripting the mapped drives to still add them into my computer as unavailable drives if the server isnt contactable, rather than just failing to map them.... therefore they are there ready when I connect my VPN at a later stage.

    is this possible PLEASE??!!
    Mark

  • #2
    Re: Force Mapped Drives to appear in "Computer"

    I dont think there is a way to change this behaviour directly, though I could be proven wrong.

    However if you want to script your way around it you could do something like this in a login script:

    Backup hosts file
    Add entry for file server to point to 127.0.0.1 in hosts file
    Use "net share" command to create a share in a temp folder with the sharename
    Do the net use command (which will actually map to your local share you just created)
    Unshare the share
    Restore the hosts file

    Not very clean, but could work

    Comment


    • #3
      Re: Force Mapped Drives to appear in "Computer"

      Originally posted by markdavies View Post
      Hi,
      Trying to solve a bigger issue with smaller steps...

      If I add a mapped drive using "persistent:yes" then obviouly the drives will appear in My Computer when the PC starts, either as working drives if the server is available, or as unavailable drives with a red cross on them if the server is not available. However I dont want them to be persistent I want them to connect as a script.

      However if i use a batch script with the following;
      net use p: \\server\pdriveshare
      when "Server" isnt contactable it just fails to map a drive;

      What I need is a way of scripting the mapped drives to still add them into my computer as unavailable drives if the server isnt contactable, rather than just failing to map them.... therefore they are there ready when I connect my VPN at a later stage.

      is this possible PLEASE??!!
      Mark
      Ok so you don't want a drive to be persistent but you want them to be there when you are offline and connect via a VPN?

      Why not just leave them as persistent?

      You could request your IT staff to write a batch script that you can run after you connect to the VPN. Leave it on your desktop.

      Does your VPN software allow you to set startup batch files??

      What are you using for VPN software?

      Comment


      • #4
        Re: Force Mapped Drives to appear in "Computer"

        Originally posted by markdavies View Post
        <...> if i use a batch script with the following;
        net use p: "\\server\pdriveshare"
        when "Server" isnt contactable it just fails to map a drive;
        Ofcourse net use p: "\\server\pdriveshare" /persistent:yes will also fail to map a drive when "Server" isn't contactable. It should have been mapped persistently at a time that "Server" was connectable - and before the next logon. Then it will be visible in explorer as disconnected drive.

        A persistent mapping is registered in the registry => a single registry key only, named after the drive letter ( HKEY_CURRENT_USER\Network\R ) and just a few entries in this key.
        You can easily create the key and add (or replace) the entries with a logon script locally on the computer. This way the user will see P: in Windows Explorer before it is connected. Because the default setting is that logonscripts run before the shell is executed.

        Sometimes a persistant drive mapping can slowdown the logon processes as it waits for the server. This can happen if the computer is in the same network as the server, but the server does not respond for some reason. If that is the case you can add the entry "RemotePath" during logon but leave it empty. Then add the path after the the destop (the shell) is loaded. You can use the STARTUP folder or the RunONCE key for this.

        Like a persistant mapping created the usual way, the mapping you created with the script is not gone after shutdown. But it can be controlled with the enforced logon script during logon.

        /Rems
        Last edited by Rems; 7th December 2013, 00:23.

        This posting is provided "AS IS" with no warranties, and confers no rights.

        __________________

        ** Remember to give credit where credit's due **
        and leave Reputation Points for meaningful posts

        Comment

        Working...
        X