Solved

How can I get rid of old drive mapping?

Posted on 2008-06-23
14
400 Views
Last Modified: 2010-04-21
We run a Windows domain with a Windows 2003 domain controller.  We have XP Pro SP3 clients.  When a user logs on there is script that runs that first clears all previously mapped drives (@echo off
net use * /delete /yes) then maps the drives needed and then runs an antivirus update.  The problem is that there are drive mappings that are no longer needed that keep getting mapped after every logon.  I have disconnected them untold number of times and they keep getting remapped.  I installed the Microsoft User Hive Profile Cleanup service to no joy.  I have searched the registry trying to find a key that I could delete to stop these old paths from being mapped and after logon they keep getting re-added to the registry.  How do I get rid of, and stay rid of, the old drive mappings?
0
Comment
Question by:BrianSDG
  • 6
  • 3
  • 2
  • +2
14 Comments
 
LVL 2

Expert Comment

by:Jamsb
ID: 21847890
Check the keys under:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2
0
 
LVL 12

Expert Comment

by:alikaz3
ID: 21847899
>>>>>When a user logs on there is script that runs that first clears all previously mapped drives

You should be able to find where this logon script is bound to a user/group. Find the association to the script file, which will lead you to the location of the logon script file. Edit the file, and remove the shares that you don't want. This should prevent them showing up.
0
 

Author Comment

by:BrianSDG
ID: 21847934
I did, as I mentioned above, after I delete the MountPoints2 keys and then reboot or log out and log back in they get rewritten to the registry and thus re-appear mapped in My Computer.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:alikaz3
ID: 21847969
Are there multiple logon scripts perhaps? Check Jamsb's suggestion for a locally entered manual map. Here is also the default file location for scripts:

%SystemRoot%\sysvol\sysvol\<domain DNS name>\scripts



Deleting them out of the script file should have taken care of it, which leads me to believe there are multiple scripts
0
 

Author Comment

by:BrianSDG
ID: 21848004
alikaz3 - The logon script is on our primary domain controler in C:\WINDOWS\SYSVOL\sysvol\domainname\scripts.  It is called as part of the AD setting for my user profile and it is a script that only runs for me.  My script is supposed to get rid of old mappings and map the ones I want but it doesn't get rid of the old ones and causes drive letter conflicts.
0
 

Accepted Solution

by:
SuBDivisions23 earned 500 total points
ID: 21848044
Can you post the script so i can see it.. It sounds like its not removing the drives before it trys to assign the new network shares to pre-exisint drive letters.
0
 

Author Comment

by:BrianSDG
ID: 21848067
@echo off
net use * /delete /yes

net use K: \\admnas\SYSADM
net use L: \\goodlink\e$
net use M: \\NASMAC\nasmac
net use O: \\CCGFS\files
net use P: \\CCGFS\Files\Archived Resources
net use S: \\MAIN\Scans

net use Z: \\nas\files\alliance_nt

REM \\MAIN\OFCSCAN\AUTOPCC

\\CCGACCT\OFCSCAN\AUTOPCC

net start "Trend Micro Client/Server Security Agent Listener"

net start "Trend Micro Client/Server Security Agent Personal Firewall"

net start "Trend Micro Client/Server Security Agent RealTime Scan"
0
 
LVL 70

Expert Comment

by:garycase
ID: 21848349
Go to C:\Documents and Settings\<User Name>\NetHood\  and delete all of the current contents (the appropriate ones will be recreated on next login).   You may have to do this not only for the main user but also for "All Users" and "Default User" depending on when the old mappings were made.
0
 
LVL 70

Expert Comment

by:garycase
ID: 21848361
... Note:  You have to have "Show hidden files and folders" enabled in Explorer to see NetHood
0
 

Author Comment

by:BrianSDG
ID: 21849075
garycase - I did with no joy.  The old mappings comeback.
0
 
LVL 70

Expert Comment

by:garycase
ID: 21849137
Did you delete all of the entries for ALL of the user accounts?
Are there any configuration settings in the programs you're loading that might reference the old mappings?
0
 

Author Comment

by:BrianSDG
ID: 21849229
I double checked all the users and there no mappings in Nethood.  
0
 

Expert Comment

by:SuBDivisions23
ID: 21849321
Going out on a limb, but i thinnk you have to add the Persistent line...

Try this on the script:

@echo off
net use * /delete /yes /persistent:yes

net use K: \\admnas\SYSADM
net use L: \\goodlink\e$
net use M: \\NASMAC\nasmac
net use O: \\CCGFS\files
net use P: \\CCGFS\Files\Archived Resources
net use S: \\MAIN\Scans

net use Z: \\nas\files\alliance_nt

REM \\MAIN\OFCSCAN\AUTOPCC

\\CCGACCT\OFCSCAN\AUTOPCC

net start "Trend Micro Client/Server Security Agent Listener"

net start "Trend Micro Client/Server Security Agent Personal Firewall"

net start "Trend Micro Client/Server Security Agent RealTime Scan"
0
 

Author Closing Comment

by:BrianSDG
ID: 31469830
SuBDivisions23 - Thanks, you got me thinking in the right direction. I switched the sections around and it worked.  But I don't know why. I took the drive mapping section of the script and put it after the anti virus update section and the old drives stopped being re-mapped. Although there is nothing in AUTOPCC that would have caused the problem.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Impact to changing AD username 2 22
upgrade exchange 2013 CU7 to CU15 9 57
Changing logon server question 5 63
Password change / expire 4 39
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question