Discussion Locked

Logon script problem

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

We just moved our share directories and private directories off a NT box and onto a W2KServer box. Now the logon script no longer works properly. The script includes these lines:

net use s: \\simrad-0\share
net use p: \\simrad-0\UserPrivateDirs\%USERNAME%
net use n: \\simrad_2\e

The first and third lines work fine. On a client I can go through network neighborhood to simrad-0\UserPrivateDirs and see all the user directories, and map a drive to the users own directory. I have replaced %username% with the login name, which is the same as the directory name, but it still will not work. What I get is the directory one level above, so instead of P: being mapped to the user's own directory, they see all user directories, and have to scroll through and pick their own directory.
How do I get this to map them directly to their own directory? The PDC is NT, the clients are NT, the file server is W2KServer.

5 replies

by hberkhoff

This is normal behaviour. To solve this problem you should 'Share' all the users directories.
Command is then as follows :

e.g. the Private dir is : e:\UserPrivateDirs
The Users have their own directorie underneith this subdir. like :

e:\UserPrivateDirs\User1
e:\UserPrivateDirs\User2

Share the User1 directorie as 'User1' (maybe a '$' behind it for hiding the share, so it can not be seen through network neighborhood.
And for the next user, User2 will be shared as 'User2'

Script will then be as follows:
net use p:\\simrad-0\%USERNAME%

After this the mapping will work.

by chipw

Okay, so far so good, mostly. It works now. I then added the $ to one user share and tested again. I get an error on the client - network name cannot be found. So it does not map that drive. Soon as I remove the $ it maps fine. Any ideas?

by bkinsey1

You added the $ to both the share name on the server and the net use command in the script and it didn't work? Proper syntax would be:

net use p: \\simrad-0\%USERNAME%$

Not

net use p: \\simrad-0\%USERNAME$%

by woody h

There is actually 2 ways to do this.
1. You can share each user folder, then the statement that you have will work. Unfortunately, if you have alot of users, that isn't really feasable. That is the problem I ran into. I didn't want 120 user shares among the others that I have for my server. SO.
2. We used the DOS subst command. You should already have a homedrive specified. You can add the following statements to your login script:

if exist l: subst l: /d
subst L: %HOMEDRIVE%\%HOMEPATH%

What that does is if the L: drive exists, it removes it. This allows multiple users to use a single computer without subst problems. The second basically would look like this, lets assume your homedrive is O: and your home directory isJoeH

subst L: o:\JoeH

when you access L: from explorer, you will see right into your JoeH folder on the O: drive. It works great. Been using this for the last 2 years now, no problems. Hope this helps.

Woody

by chipw

Thanks, with a combination of both I now have tested and verified that this works -

if exist p: subst p: /d
subst p: \\simrad-0\%username%$

That provides a mapping to the users private network drive, and there is no disconnect option on the right-click menu, as on a typical mapped drive, cool. Also, because of the $ it does not show in network neighborhood, also cool.

In my testing I have found that a previously static mapped drive appears to cause a problem with the script. The erroris -

if exist S: subst S: /d
invalid parameter - S:
subst S: \\simrad-0\Share
invalid parameter - S:

For whatever reason, a few people have staticly mapped the network share directory to S:. Can I set the script to force itself over any static mappings?

This discussion is closed to new replies.