Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Share Name Displayed for Re-mapped drive

Status
Not open for further replies.

lameid

Programmer
Jan 31, 2001
4,212
US
I am using XP Pro SP2.

I have a batch file I use to remap a Mapped Network Drive using Net use.

Example:
net use t: /delete
net use t: \\Server\Share

My issue is that when I run the batch file that the description for the mapped network drive in explorer which should read "Share on Server" instead reads "ShareName on OtherServer". I know by the contents of the disk that the drive mapping has in fact been changed.

Any ideas? Win Explorer is how I usually check to see wether I'm in a test environment or not.
 
I've seen this with static mapped drives in XP. Honestly, I haven't bothered digging for a permanent fix to this (I'm removing all the static mappings and getting us setup proper! Yay). What I would say to do is to add, as part of the batch, a rename line for the mapping and you should be good to go.
 
Thanks for the input...

I'm not familiar with rename, could you please give me an example.

How are you setting up 'proper'? Direction to the appropriate help topic should be good enough for me.

Thanks again.
 
Unless the connection is persistent, the DriveLetter subkey is deleted when you delete the mapping. If in the same session, you map DriveLetter again, the New Name is restored from memory, even if the mapping is different. You must logoff after you delete the mapping for New Name to be forgotten.

Windows XP permanently stores this information at:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
\MountPoint2\##ComputerName#ShareName, in a Value Name of _LabelFromReg, a
string (REG_SZ) data type. The data value is the plain text New Name.

Even if you delete the mapping, when you map any drive letter to this \\ComputerName\ShareName, the New Name will be displayed. The only way to change it is to rename it again, or delete the ##ComputerName#ShareName subkey.

Courtesy of comments by Ross Presser

See also:
 
I had a simular issue do to static mappings in the default profile on XP. It was not properly deleting the shares on login using the net use /delete command. What fixed the issue for me was forcing my login scripts to run Asynch using a GPO. That may fix your issue also.
 
1101001100110101,

By GPO, you mean Group Policy Object... So my problem is using an old school logon script instead of group policy. I knew finally getting rid of that last Win 98 Machine was good news. I just wish I had already gotten around to learning Group Policy...

Anyway thanks for the tip, I hope to check it out in the near future.

-I hate ignorance, especially when I'm the one [tongue]
 
Any logon will clear the named entries so that you start fresh. It does not matter if the logon is asynchronous or not (although I too force that in Group Policy).

The issue is the name that appears in explorer during a single session. This is persistent if not renamed.
See my explanation above.
 
Yup, I mean Group Policy Object. But your script should work, you just need to make the machines run them step by step or Asynch. You still would run the same script it is just the way it's processing on the XP machines. You may want to just test it out first to see if it does fix your issue. Go to one of your machines login as the an administrator and type gpedit.msc in the run box. This opens the local policy editor.

Once open expand the Admin Templates, go to System and then Scripts one of the settings says run startup scripts async. You can also look around and see all the other settings you can mess with if you want :) . Once you make that change and restart the pc if your script runs correctly then that's your problem. If not then no need to waste time with a policy for your machines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top