How to Fix: Can't Access Mapped Network Drive via Administrative Command Prompt

Dennis Faas's picture

Infopackets Reader Neil S. writes:

" Dear Dennis,

I am trying to access a mapped network drive via an administrative command prompt in Windows 10, but I keep receiving the error that 'The system cannot find the drive specified.' The strange thing is that if I run a regular command prompt, I can access the mapped network drive. I am trying to write a batch script to perform maintenance on the network drive, and I need administrative access to be able to do it. Can you help? "

My response:

I have run into this problem a number of times. There are two ways to get around this issue: one is to try a registry hack to allow mapped drive access via an administrative command prompt; another way is to use the 'net use' command to re-map the drive. I'll explain both methods below.

How to Fix: Can't Access Mapped Network Drive via Administrative Command Prompt

  1. First, bookmark this page because you will need to reboot the system and come back to the article to finish reading the instructions. To do so: press CTRL-D on your keyboard; the page will be bookmarked automatically or it will prompt you to click "OK" to bookmark the page.
     
  2. Next, I'll explain how to invoke the registry hack which allows mapped network drive access via an administrative command prompt.

    From what I've read online, this "hack" works for some users, but doesn't work for others. I have tested this method using Windows 10 version build 14393 (Anniversary Edition) and build 15063 (Creators Update), and it worked fine for me. To make the changes, I've created a small script below - you just need to copy and paste it to an administrative command prompt, and the registry key will be automatically added to your registry.

    To do so: Click start, then type in "cmd" (no quotes); wait for "CMD.EXE" or "Command Prompt" to appear in the list, then right click it and select "Run as Administrator". Next, highlight the text below with your mouse:

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLinkedConnections" /t REG_DWORD /d 1 /f
    echo this is a dummy line

    Right click over type of the highlighted text and select "Copy" from the dialogue menu. Now, go to the middle of the administrative command prompt window and right click the mouse, then select "Paste" from the dialogue menu. The text you copied above should now be output onto the command line.
     
  3. Now it's time to reboot the computer. Bookmark this page if you have not done so already (explained in Step #1), then click Start -> Shutdown and reboot. Once you have done that, open up an administrative command prompt and attempt to access the mapped network drive. If you receive the error 'The system cannot find the drive specified', proceed to the next step.
     
  4. Another way to gain access to a mapped network drive via an administrative command prompt is to use the 'net use' command. This basically re-maps the drive via the command prompt and magically provides access to the drive. To do so: open an administrative command prompt, then type in the following:

    net use X: \\remote-machine\folder /persistent:yes

    Where "X:" is the drive letter to be mapped, "remote-machine" is the remote machine and the "folder" is the remote folder (or drive).

    Example:

    net use s: \\server\s /persistent:yes

    This would map S drive to the remote machine 'server' using the remote share 's' (folder or drive).

    The system may ask if you want to map the drive and also some credential information; enter in the information as necessary. If you receive an error, you will need to re-map the drive again using the Windows interface (GUI), then try again using the command prompt method again. The second time usually works for 'problematic' connections based on my experience.

I hope that helps.

Got a Computer Question or Problem? Ask Dennis!

I need more computer questions. If you have a computer question - or even a computer problem that needs fixing - please email me with your question so that I can write more articles like this one. I can't promise I'll respond to all the messages I receive (depending on the volume), but I'll do my best.

About the author: Dennis Faas is the owner and operator of Infopackets.com. With over 30 years of computing experience, Dennis' areas of expertise are a broad range and include PC hardware, Microsoft Windows, Linux, network administration, and virtualization. Dennis holds a Bachelors degree in Computer Science (1999) and has authored 6 books on the topics of MS Windows and PC Security. If you like the advice you received on this page, please up-vote / Like this page and share it with friends. For technical support inquiries, Dennis can be reached via Live chat online this site using the Zopim Chat service (currently located at the bottom left of the screen); optionally, you can contact Dennis through the website contact form.

Rate this article: 
Average: 5 (7 votes)