Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


MrJinje

Losing mapped network drives

Recommended Posts

I lose access to mapped drives when browsing for DVD folders via the Add Button.

 

Can you remap network drives from the current session into the elevated session during open ?  

 

 

Share this post


Link to post
Share on other sites

Set the option EnableLinkedConnections (DWORD) under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System to 1

Share this post


Link to post
Share on other sites

On every machine I plug this into ?  Last I checked, it's $249 for the USB corporate version.   Imagine some of my clients won't like me introducing another 24/7 security risk to their domains.

 

Why not a loop routine during the onopen and onclose events.   Temporary mapping, only for the duration of NTLite, un-map them afterwords, leaving no trace.

Share this post


Link to post
Share on other sites

MrJinje, no reason to panic, I haven't even replied yet.

 

So I opened NTLite on a machine which has a mapped network share as a drive, and went to Add button to browse around a little.

The mapped drive is still there in Explorer. Haven't seen it in the tool's browse btw.

 

Can you please elaborate in a little more detail how to see the effect of that issue?

Edited by nuhi

Share this post


Link to post
Share on other sites

Test box is a Windows 8.1 x86 inside vmware.    Opened NTLite after installation, attempted to browse.  Did not see the mapped Z: drive which is mapping to shared folder on host machine.

 

I manually mapped the drive via net use command in elevated cmd.exe window and NTLite could see the drive.

Edited by MrJinje

Share this post


Link to post
Share on other sites

Oh, so the issue is that NTLite can't see mapped drives by explorer, only by elevated CMD.
If I understood you correctly, then I have replicated the issue.

At first it looked to me that you said that the tool is breaking your mapped drive, which made no sense to me.

 

Ok, I'll check what can be done regarding the browsing of mapped drives.

Share this post


Link to post
Share on other sites

The top key is a letter and the value "RemotePath" is the path.  Those two values are all you need. 

Windows Registry Editor Version 5.00[HKEY_CURRENT_USER\Network][HKEY_CURRENT_USER\Network\Z]"RemotePath"="\\\\vmware-host\\Shared Folders"

So from a programming stand point, just loop through HKCU\Network, look for top level keys (which are single letters), and read it's RemotePath value.   Use the net mapping API as it will perform faster than "Net Use".   ad infinitum OnLoad event. A second loop removes them during the OnClose event.

 

That setting Andre mentions requires a reboot before it takes effect, re-mapping of pre-existing drives on the fly does not.  The effect is instantaneous.  Very easy to do.  No need to make permanent settings on every machine.

Net Use Z: \\vmware-host\Shared Folders

EDIT: I read the article you linked, it seems they back up my story, but for different reasons.

 

Update for Windows 8

It appears that the EnableLinkedConnections setting is not always working correctly on Windows 8: if a standard user has created a mapped network drive pointing to a subfolder of a shared folder (for example, drive Z: connected to //server/share/subfolder), then the elevated user will see the drive Z:, but it will be pointing to the root share, //server/share/, not to the subfolder.
 

If this error creates a problem for you, then it’s better not to use the EnableLinkedConnections registry fix at all. Instead, just create the mapped network drive twice: first time using a standard user’s account, and the second time using an administrator account. Sure, it’s twice the work, but it should work correctly in all situations.

Edited by MrJinje

Share this post


Link to post
Share on other sites

MrJinje, thanks. So checking if I understood you correctly, the only way to do this is to temporarily re-map existing maps per user and unmap on exit. Hm...

I appreciate the solution and will let it cook for a while.

 

First things that come to mind to check are:

- are mapped drive letters duplicated in Explorer

- can we mount WIM from a share

If you already know the answers, even better.

Edited by nuhi

Share this post


Link to post
Share on other sites

1) No they are not duplicated.  

2) Yes of course.

 

Here is a powershell snip that prints out net use commands for proof of concept.

$MAPS = Get-Item HKCU:\Network\*ForEach ($MAP in $MAPS) {    $KEY = ($MAP).name    $UNC = (Get-ItemProperty -Path "registry::$KEY" -Name "RemotePath").RemotePath    $LETTER = Split-Path -Path $KEY -Leaf    Write-Host "Net Use "$LETTER": "`"$UNC`"    Write-Host "Net Use "$LETTER": /DELETE /YES"}
Edited by MrJinje

Share this post


Link to post
Share on other sites

MrJinje, seems like I might need to do this one day, **** :)
Thanks, appreciated.

Share this post


Link to post
Share on other sites

Here is an Official™ kludge for readers who cannot wait. Rename attachment to .ps1 and it will do the rest. Side effect, the %TEMP% setting no longer reverts to %APPDATA% upon open. 

NTLite_Starter_Tool.ps1.txt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×