Solved

Login Batch Script not updating on login?

Posted on 2006-11-14
6
311 Views
Last Modified: 2008-03-03
Hi everyone, currently we have several batchfiles that take care of mapping net work drives.  For sometime these have been working with no problems, however we have come to change the mapping on one of the drives on boot, so have included the command to delete the current mapping before recreating the mapping to the new location.  This is not working as i would have expected.

When the user logs in the old mapping is still pointing to the wrong location.  I have tried to run the mapping manually on the desktop and this works (even when i run it through the Netlogon share on the DC(s), however it does not on boot and login,  I did try removing the profile path in the users profile and add it as a Logon GP in AD but this did not work either.  If i delete the local user profile on the desktop , this obviously works, but i don't really want to do that?  Any ideas appreciated.  (i have not tried to change the .bat login file into a .cmd file, would that be advisable before adding it to a GP in AD?

a sample of the exact script is below (its about as simple as it gets)

net use n: /delete /yes
net use n: \\bws-app01\home\staff

(note. the previous instance is referencing \\curriculum02\home\staff, as N: and want to replace this with the above.

Thanks
Leon
 
0
Comment
Question by:leont
[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
  • 3
  • 2
6 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 17937640
.bat=.cmd - realistically synonomous - they're run the same.

You're certain that the logon script is being run?

For the above, I don't see right off what would cause it to fail.
You might try reversing the process
and then some troubleshooting steps:

  echo y|net use n: /del
  if exist n:\nul echo N drive still connected && pause



0
 

Author Comment

by:leont
ID: 17937993
Hi Sirbounty, the batch is definately running, as it says it completed the mapping when you step through, however you go into windows explorer and it is still referencing the old drive mapping of \\curriculum01\whatever whatever and not the new \\BWS-FAP01\whatever whatever, does that make sense?
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17938028
I was going to suggest a log file to check what is going on, i.e

net use n: /delete /yes >%userprofile%\netuse.log 2>&1
net use n: \\bws-app01\home\staff >> %userprofile%\netuse.log 2>>&1

to redirect output of commands and errors to \ log file called netuse.log in the user's profile.  Assuming you can't see it running for some reason (e.g. login scripts are displaying as hidden) that might point out why.

It could also be they have a persistent mapping so the script removes it then they login and it puts it back.  I always do:

net use /persistent:no

at the top of login scripts to stop this behaviour.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:leont
ID: 17938261
Hi Sirbounty, apparently you were right the profile was trying to call a batch file from a strange source and would not run the correct one (even though the profile/login script directory in AD was pointing to the correct one?), as i say weird but it but your comments pointed me in he right area, many thanks, enjoy

leon
0
 

Author Comment

by:leont
ID: 17938293
Sorry Dragon-it, page refreshed after i accepted sirbounty's answer.  Thanks for everyones help.
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 17938495
Just bad timing ... if I'd have refreshed I'd have seen your comment!
Steve
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

689 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