I have a Script that I am using to try to modify the Drive Mappings on my system. It performs both NET USE [Drive Letter] [Share Path]
and NET USE [Drive Letter] /delete
, and both of those operations complete successfully (as confirmed by NET USE
on its own), but when I open File Explorer, any Mappings that I changed, added or deleted through there are not displayed, and I can even still access the Shared Folders through those Mappings.
For Example:
- I create a Mapping (B:) to
\\127.0.0.1\ShareA
, which I can access by going toB:
- I then run
NET USE
and I get a list, with one entry, sayingStatus: OK, Local: B, Remote \\127.0.0.1\ShareA...
- I then run
NET USE B: \\127.0.0.1\ShareB
, which a readout stating the operation completed successfully - I re-run
NET USE
, and the single entry has had its Remote value changed to\\127.0.0.1\ShareB
- I open Explorer (or Run) and go to
B:
, and I getShareA
, notShareB
I have done the same with /delete
, first time being successfully completed, the next throwing error 2250 (doesn't exist), but the Mapping is still there in File Explorer.
What is occurring that prevents these changes from being propagated to Explorer?
P.S. I am running CMD as an Administrator, I have also tried Restarting the Windows Explorer
process (for Folders and Shell, I have the two separate), but neither has made a difference. I am about to try a restart, but that is not a valid solution as these changes need to be made while the system is up.
P.P.S. I have just tried NET USE \\127.0.0.1\ShareA /delete
, but I get the same 2250 error