I have found this logon batch file script somewhere on the internet and have modified it to suits for our domain. I like author idea of drive mappings. Drive mappings are broken out from IFMEMBER statements, because a user might be in a read-only group, or they might be in another group that has more permissions. Either way, the NET USE command is used only once which is more efficient in case the user is in both groups. Logon script work fine and very fast.
Here is my problem. If the user have USB hard drive or USB flash stick with the same drive letter, logon batch file fails with this error:
"System error 85 has occurred.
The local device name is already in use."
Because of this error user don't have network drive mapping. The only way to fix this problem is to manually change drive letter for USB drive to be something different and re-run batch file again.
I have some skills in batch file creation but luck of more advance knowledge and time put me on pressure to make this scrip work correctly as soon as possible.
I need someone with good batch file creation skills to modify/edit my script to include checking procedure. Let's say, if the Drive Letter already in use by USB hard drive, logon batch script should assign next available drive letter for the network drive. Would be nice (and preferable) if batch logon script can change drive letter for the actual USB drive so we will have consistent network drive letters name but I guess it will much more difficult to achieve. Some kind of user warning notification should be also pop-up for the user saying that, because this drive letter already in use by USB hard drive the logon batch file temporary is using other letter for this network drive.
For some of the wireless laptop users logon batch script is not always run during logon. I'm thinking on start using persistent drive mapping. So, if network logon script is missed during logon, users will have network drives anyway. I heard somewhere that using persistent map drives not always a good idea. Reason for this can be a situations when network drives locations have been change. Users with persistent old drives will see "The local device name is already in use" error message. They need to disconnect the old mapping and re-logon.
As I said before I would like to start using persistent map drives (net use /persistent:yes) so my batch logon script has to be smart enough to detect old persistent drives, remove them and map new once.
Thanks in advance.