Link to home
Start Free TrialLog in
Avatar of ScottCL
ScottCL

asked on

Mapping drives with logon script.

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.
ASKER CERTIFIED SOLUTION
Avatar of dis1931
dis1931

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ScottCL
ScottCL

ASKER

Add that line in the logon script? Or just do it on computers with trouble?

We have Win9x and XP machines.
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
Avatar of Lee W, MVP
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.