?
Solved

Login Batch Script not updating on login?

Posted on 2006-11-14
6
Medium Priority
?
313 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 2000 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

Many of us need to configure DHCP server(s) in their environment. We can do that simply via DHCP console on server or using MMC snap-in on each computer with Administrative Tools installed in a network. But what if we have to configure many DHCP ser…
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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 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