Logon batch file won't run at every logon
Posted on 2008-10-23
I am trying to map a network drive for the users in my company using a batch file. We are migrating from a server that was hosting the mapped network drive, to a new server that will be the new host of the mapped network drive. So I need to keep the same drive letter, with pretty much the same directory structure but just the server name will be changing. We will not be using the old server name of the old host because it will still be hosting other processes and can't be taken off-line.
Below is an example of the batch file I am trying to run.
net use h: /delete
net use h: \\newsrv\share
I have it added to a test user in Active Directory under profile --> logon script. When I log the user on, it doesn't delete the old H: drive and re-map the new one, however if I immediately log off and log back on, it maps it. It doesn't matter how long I wait to logon after I change the batch file (another batch file is listed for all users to map more network drives) It just seems like it only checks for a batch file at every other logon attempt.
I also tried pushing the batch file using Group Policy by commputer account, and it does map the drives, but all of the drives show up under My Computer with names of Disconnected Network Drive.
Is there a better way to do this? If so , i'm open to your suggestions.