0

My company laptop runs a command line script during boot which adds a set of network drives to the Windows. I'm not using any of these during work at all, I don't even have access to some of them (when I double click the drive I get an Access Denied error).

Lately I often have to connect to a VPN service for work with another company, and when I'm connected to their VPN, none of my company's network locations are available. Which produces a strange side effect: for some reason disk access becomes severely limited, e.g. when I click a download button in the browser, I have to wait 4-5 minutes for the download location popup to open, in the meanwhile the browser seems frozen. Similarly when saving files.

I can do the following: before I connect to the VPN, I can manually right click and disconnect each network drive. However I don't want to do this every single time, it's 6 drives, sometimes I forget and I have to disconnect the VPN, remove the drives and reconnect the VPN to solve the disk problem (disconnect doesn't work when on the VPN).

I tried to use the 'net use X: /delete' command from an administrator cmd to disconnect the drive (hoping to create a script to remove them), but for some reason it doesn't work. I get the below error:

C:\WINDOWS\system32>net use G: /delete
The network connection could not be found.

More help is available by typing NET HELPMSG 2250

Interestingly, 'net use' command output is empty:

C:\WINDOWS\system32>net use
New connections will not be remembered.

There are not entries in the list.

So, how come 'net use' says the list is empty, and it is not able to find the network connection, when I can see the mapped network drives with drive letters (G, H, etc) in the Windows file explorer, and I can right click and disconnect from them?

  • I'm not using any of these during work at all, I don't even have access to some of them Ask your admins to exclude your workstation/account from this policy. – Akina Sep 4 at 6:34
  • Well, this could be a viable approach also, but I fear I would be going down the rabbit hole through the endless company policies and protocols. – Gábor Major Sep 4 at 8:43
1

By default, drive mappings are completely separate for normal and elevated environments. You cannot use the "administrator" Command Prompt to manage non-admin network drives.

You can share network drive mappings between your own normal and elevated environments by changing the EnableLinkedConnections option. However, different user accounts will still always have separate drive mappings.

  • Thanks, this was reason. I was trying the command from administrator cmd, but I should have used my own user's cmd. Strange, I would expect a local admin user to be able to do this. Thanks again, I would upvote your answer but I can't yet :) – Gábor Major Sep 4 at 8:40
  • Different users can have different network drives, that's completely normal... – grawity Sep 4 at 8:58
  • @GáborMajor net use manipulates the current users mapped drives. When running cmd as admin, the current user in that session is the local admin. You can then map drives in that cmd prompt session separately to your own user session. – Smock Sep 4 at 8:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.