Solved

Mapping drives with logon script.

Posted on 2004-09-09
4
265 Views
Last Modified: 2013-12-28
Every user on my network has a batch file the runs when the logon that maps drives.

Part of it is:

NET USE R: \\server1\path

I had to change the path but keep the same drive letter asssigned. So I edited the line in the batch file to

NET USE R: \\server2\path

Now pretty much no computer on the network will map this path at logon, Win9x or WinXP. I have to manually run the NET USE command to map it.

What is preventing the the mapping of this new path with the same drive?

Thanks.
0
Comment
Question by:ScottCL
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
dis1931 earned 500 total points
ID: 12016730
Try deleting the original drive mapping before re-mapping.  So do a net use /delete R: and then do the net use R: \\server2\path
0
 

Author Comment

by:ScottCL
ID: 12016901
Add that line in the logon script? Or just do it on computers with trouble?

We have Win9x and XP machines.
0
 
LVL 10

Expert Comment

by:dis1931
ID: 12017090
You can add it to the logon script.  All it will do is check if there is a R: drive if so it will delete it and then the next line can be used to map to R: drive which is now empty.  If it is already not present then it will display some text real quickly that will read:

"The network connection could not be found.

More help is available by typing NET HELPMSG 2250."

Then it will map the drive.  

First try it on a machine having trouble and see if it works.  If it does add it to the logon script.

Dis
0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 12021716
I like to create logs in my login scripts.  Also, execute them from the command line manually to see what is happening.  Net use may work just fine, but run the script itself to see the results.

map z: to \\dc\netlogon
Then from a CMD prompt, type the login script name and watch what happens.

Make sure you have a significant buffer space in the CMD window so you can scroll up and see what's going on.

Make a test login script that's the same as the problem one.  Then redirect all output to files.  For example:

REM My Sample Login Script
@Echo Off
REM Connect to my group's share
ECHO Connect to my group's share > c:\loginscript.log
ECHO Checking for existing drive R: >> c:\loginscript.log
IF EXIST R:\ NET USE /DELETE R: 1>> c:\loginscript.log 2>>&1
NET USE R: \\SERVER\SHARE 1>> c:\loginscript.log 2>>&1
REM Start Monitoring Software
ECHO Starting Monitoring Software >> c:\loginscript.log
START MonitorSoftware 1>> c:\loginscript.log 2>>&1
REM End Script

The above sample will create a log explaining what's going on with every login.  You can then use Administrative shares to connect to the remote computers and check the log when problems occur.

0

Featured Post

Are your corporate email signatures appalling?

Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

Question has a verified solution.

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

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

912 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now