Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How can I get rid of old drive mapping?

Posted on 2008-06-23
14
Medium Priority
?
409 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
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 1500 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Let's recap what we learned from yesterday's Skyport Systems webinar.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

719 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