startup script


Recommended Posts

Ok I'm interested in writing a startup script that will load a folder on my computer that has other mapped network drives in it. I also want to use a single username and password to do this. Anyone know how I can do this?

Link to comment
Share on other sites

You could create a batch file using the following command....

net use x: \\server\share /user:domain\username password /persistent:no

or

net user x: d:\localshare /user:computername\username password /persistent:no

If the PC is not a member of a domain then you do not need to include the domain\ or computername\ in the /user: command. You do not need to have computername\ but it's not a bad idea. You can even make it %computername%\ and (where computername is not actually the true computername, but what exactly is typed) it will input your computername for you automatically. You could drop this file in All Users startup or your own startup or useing group policies. There are other ways to do it, but this is the most simple. If you do not care to see the output created by these commands you should do something like this...

@ECHO OFF

net use x: \\server\share1 /user:domain\username password /persistent:no>nul

net use y: \\server\share2 /user:domain\username password /persistent:no>nul

net use z: \\server\share3 /user:domain\username password /persistent:no>nul

This will keep your password from showing in the command window and will suppress any output created by the net use command (it usually says "successful" or something like that..)

Play around with it and let me know how it works for you..

Good lucK!

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.