Discussion Locked

Net Use Command on Startup Script

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

I'm about to roll out a Win2000 server and am working with a startup script in my default domain policy. I'm attempting to use the net use command to map a series of drives for all machines on startup, but the script is failing because of a passwordproblem.

I'm trying to use net use n: \\172.16.100.11\c. I've also tried net use n: \\172.16.100.11\c password | test.

Is the net use command available on machine startup to map drives prior to a user logon, or am I just trying to do something impossible?

Thanks,
David

3 replies

by joseph moore

Yes, NET USE is available for use in Win2K during the logon script phase. It works just fine.
It sounds like you are just trying to access a share with an account that does not have the proper rights.

"n: \\172.16.100.11\c" is what you are tyingto map to. Now, did you set up a share specifically called C or are you trying to map to the administratively-created C$ share that is access to the root of drive C:?
If so then you need to map to the full share name, C$, like this:
NET USE n: \\172.16.100.11\c$
And the account that is in use when this mapping happens must have administrative rights to connect to this share. Members of the Administrators group are the ones who can go into this share. Normal users cannont.

Now, you can specify to map the drive using a specific user account. Let's say you want to map N: to the C$ share on 172.16.100.11 like you said in your message. And let's say you want to use your domain Administrator account to do the mapping. So, when user Bob logs in, his drives map normal, but for drive N: it maps using the Administrator account. Here is how that would be set up:

net use N: \\172.16.100.11\c$ /persistent:no /user:YOURDOMAIN\Administrator "PASSWORD"

Of course, you would change "PASSWORD" to the Administrator password.

Now, doing this second thing leaves 2 potential problems. One, the Administrator password is in a flat text file. If you do not suppress the messages during the logon script (with the @ECHO OFF command) then yourusers will be able to read the password. And if anyone just happened to edit the logon script file, they would get the password.
Also, if you change your Administrator password every so often, you will have to remember to change it in the script, or the mapping will fail.

Hope this helps.

by shanghai sam

This was very helpful. We had created a share C, but had problems with the net use syntax. The Windows help wasn't as clear as your answer, which cleared up our problem. Thanks also for the 2 cautions. We've created a dummy user with no special rights to use in the script to prevent the administrator from being used, disallowed the script from being visible during startup, and used the @echo off line. We feel like that's sufficient to keep us protected from prying eyes (at least during the start up cycle!)

Thanks again.

This discussion is closed to new replies.