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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drive Mapping - Reconnect at logon option overiding script

Status
Not open for further replies.

dave123456789

IS-IT--Management
Apr 24, 2007
7
CA
I have implemented a drive mapping script as follows:

' Drive mappings for migrated NCR USers
If InStr(strGroup, lcase("cn=migrated_users_NCR")) Then
objNetwork.RemoveNetworkDrive "p:"
objNetwork.RemoveNetworkDrive "g:"
objNetwork.RemoveNetworkDrive "n:"
objNetwork.RemoveNetworkDrive "s:"

objNetwork.MapNetworkDrive "g:", "\\server\groups"
objNetwork.MapNetworkDrive "n:", "\\server\NCR\MailArchive\" & strUserName
objNetwork.MapNetworkDrive "s:", "\\server\NCR\Software-N-Templates"
objNetwork.MapNetworkDrive "p:", "\\server\NCR\Public"
End If


since applying this script at logon, i noticed that if a drive was mapped MANUALLY using the Reconnect at logon option prior to running the above script, the NEW drive mapping does not take effect, it seems that the Reconnect at logon option is overriding my script. The only solution at this time is to have my clients Disconnect manually, then log off/on again to receive the new mapping.

My question is : Is there a command that i can include in the above script that will force a disconnect?

Regards,

Dave
 
Is the script working to map the drives if they are not in use? Use capital letters for the disconnect portion, Windows stores its drive letter with capital letters.
 
Thank you for replying.

yes, the script is working to map drives that are not in use. I'll give you suggestion a try (capital letters) once i get to work. If a drive is in use but was originally set with the <reconnect at logon> option, the new mapping does not work, it will keep the old mapping, again, any drives mapped without the <reconnect at logon> will disconnect and map the new drive location...so i need to find out a way to overide the <reconnect at logon> setting.

By the way, where does windows store it's drive letters?

Cheers!
 
In the registry, HKEY_CURRENT_USER\Network\*drive letter* is the only place I know of.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top