none
Mapped network drive letter not available in command prompt

    Question

  • Hello,

    first post here!

    The following is happening:

    While mapping a external share to a drive letter, the drive letter is not available
    on the command line.
    Running as administrator does not resolve this.
    Is this a permissions issue? On my test machine it works fine, but on a client's
    machine I can't get them to show up no matter what I do. Only physical drives
    are available on the cl, but all mapped drives are available when using the UI.

    Hope you can help.

    Marinus.
    Friday, October 19, 2007 2:48 AM

All replies

  •  

    I got exacle the same. And a Windows program (ActiveSky) won't run properly because of this:it can not find shared folders on a different computer.

     

    Drive free space info in 'My Computer' is also not shown for the mapped drives until drive is opend via explorer. So looks like a network connection not opening.

     

    I tried:

    Different (new) user on same machine.

    And various batch files dir f:\ and looked at NET ... commands.

    Changing network tcpip and sharing options

    This all fails.

     

    It seems I just found a workaround (need reboot to test properly)

    Opening the maped drive via the explorer command line options, putting this in STARTUP using a shortcut

    (explorer /n,f:\ to open the f: drive)

     

    However this leaves open unwanted windows. So looking at a proper solution on how to access mapped network drives from command prompt, that is how to open the network connection properly so windows programs and cmd  promt do find and open mapped drives.

     

    Hajo

    Monday, October 22, 2007 6:17 AM
  •  

    Unfortunately this warkaround also did not work on statup:

     

    An error occured while reconnection F: to [\\pc\share]
    the requested recource is in use

    connection has not be restored.

     

    So how to get network connections really active on system startup automatically (so without first browsing via My Computer)?

     

    BTW: this occurs on a Workgroup solution, just connecting 2 PC's, connected via tcp/ip using fixed IP addresses. Marinus: what network setup do you have problems with?

     

    Hajo

     

     

    Monday, October 22, 2007 6:44 AM
  • Hoi Hajo,

    the setup is Vista to a Buffalo TeraStation (Linux/Samba) on a LAN.

    I fixed it with SUBST but that's pretty ugly; I have to do SUBST S: T: and SUBST S: /e when I'm done syncing.

    S: is the letter of the mapped drive, which is available through Explorer.

    A normal solution would be nice. If you find out anything more then let us know.

    Marinus.
    Thursday, October 25, 2007 9:10 PM
  • I've just come across this on my vista machine and NAS. 

     

    I used "cmd S:" from the start --> run menu and whilst the command window opened on the c drive, it then recognised the s: drive.

     

    TJeffer

    Friday, January 18, 2008 4:40 PM
  • Hello.

    This is an old topic, I know, but it carried over to Windows 7 and this article came the closest to the issue I was searching for.  Through "trial and error" I found a solution to the problem I was seeing like this by:

    1) make sure the command prompt was opened as an administrator (allows access to all folders)

    2) use the command "net use <drive letter> \\<servername>\<sharename>" for the share you need to access

    I recommend trying this without running the prompt as an admin first to see if it does what you need.  In my case, I was copying shortcuts to the c:\users\public\desktop folder through a batch file to install custom utilites we use, so I required the admin access.

    Also...and this may be a Windows 7 thing as didn't use Vista much...I found that in a standard (non-admin) command prompt session, I could access the network shares, but I could not through an admin command prompt.

    I found that I could include this line as part of the batch files I use as long as the batch files were run as an administrator.  It worked like a champ.

    -Scott

    • Proposed as answer by Phat Huynh Wednesday, September 12, 2012 8:00 PM
    Wednesday, April 21, 2010 12:53 PM
  • 2) use the command "net use <drive letter> \\<servername>\<sharename>" for the share you need to access

    -Scott

     

    First of all, this problem is SOOOO BOGUS it beggars the imagination. . . .  IMHO, this is like saying "The command prompt cannot copy/rename/change directories", etc.

    The ability to access a properly mounted, networked drive should be, and is, fundamental to any operating system more recent than CPM.  Especially, from a sysadmin point-of-view it makes batch file scripting a nightmare - that is more so than it is already.

    Even though you can work-around it with a "net use", I personally feel that this borders on a horridly ugly hack for functionality that should exist by default.  And HAS existed by default before.

    In addition, requiring "net use" prevents a non-Administrative user, who is familiar with the command-line, from making use of resources that he may be perfectly authorized to use.  (i.e.  Uploading a bunch of edited documents or test-scripts to a globally shared resource, using parameters like "/D" to limit the upload to modified objects only.)

    In summary I feel that this is absolutely unacceptable and should be logged by Microsoft as a Sev-1, Priority-High bug for immediate resolution.

    Note that I have not yet tried using the command line to map:

    • A shared and mapped drive whose target is another Windows machine.
    • Specifying an administrative share (c$, etc.)
    • Specifying a drive via a URL (\\system\share or \\[IP address]\share

    It would be interesting to see if anyone else has tried these.

    What say ye?

    Jim (JR)

     

    Friday, November 04, 2011 8:55 PM
  • Update:

    I just found an article (http://tinyurl.com/5sunjbb) that describes a Registry edit that resolves this issue.

    (Quote)

    The problem was solved after I created the EnableLinkedConnections DWORD value in this registry key

    and set its Value data to 1:

    HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Policies \ System

    The EnableLinkedConnections value enables Windows Vista to share network connections between the filtered access token

    and the full administrator access token for a member of the Administrators group.

    [NB: This requires a system reboot to take effect.]

    (/Quote)

    This article goes on to quote a Microsoft source that claims this opens a rather nasty security hole for clever malware - so though workable, it's not the correct solution - at least not yet.

    My original opinion and comments remain unchanged.

    What say ye?

    Jim (JR)

     


    • Edited by Jharris1993 Friday, November 04, 2011 9:13 PM
    Friday, November 04, 2011 9:12 PM
  • Hi -

    Thanks for the ("cmd: S") tip.  That's just what I needed (learn something new every day).

    Bob

    Tuesday, February 07, 2012 6:46 PM
  • I am facing the same issue using a Windows Server 2008 R2 Standard. To workaround I used the "net use" where I can make use of a DOS command view running as admin, once that I need run some scripts as admin user. I agree that this should have a solution cause I took a good time trying to figure out why I was not able to run dir, copy, etc on the mounted driver.

    Cheers.


    System Architect

    Wednesday, February 22, 2012 12:22 PM
  • use cd /D(Drive letter):\

    It worked on my win 7 home prem. sp 1.

    Sunday, June 10, 2012 1:03 PM
  •    
    • Open registry editor and locate the following path

        HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters

    • In the right pane, click the autodisconnect value, and then on the Edit menu, click Modify. If the autodisconnect value does not exist, follow these steps:

            On the Edit menu, point to New, and then click REG_DWORD.

            Type autodisconnect, and then press ENTER.

            On the Edit menu, click Modify.

             Click Hexadecimal.

    •   In the Value data box, type ffffffff, and then click OK. Close the registry editor and restart the PC.

    Regards Jinish.K.G|HCL Infosystems LTD

    Monday, June 18, 2012 11:02 AM
  • For example x:\ is the remote mapped drive

    Only issue i have had is with the cd command. cd x:\ will not change the current directory, but doing dir x:\ will produce a listing of the directory. also copy x:\somefile.txt c:\somefile.txt or edit x:\somefile.txt works fine.


    • Edited by pberezansky Monday, December 03, 2012 6:13 PM
    Monday, December 03, 2012 6:10 PM