Automatically add / create network drive share

To have your PC automatically connect to a network share and map that drive as a local drive drive letter in My Computer, do the following:

Open notepad and create a file called networkshare.bat

Now add the following two lines:

net use Z: SERVER_NAME FOLDER PASSWORD /user:”USERNAME
exit

Save and close, add the batch file as a shortcut to your windows startup folder
(you can add as many net use lines as you wish, as long as you have drive letters spare)

Z: The drive letter that the share appears in on My Computer of the Local PC

SERVER_NAME is the name of the pc to connect to

FOLDER is the name of the folder that is being shared

PASSWORD is the password

USERNAME is the username

It is assumed that on the PC / Server that has the folder being shared, you have created a user account with a username and password already

It is also assumed that the folder that is being shared as a network mapped drive has its share name created with no spaces, ie. an underscore being used instead of spaces in the share name

It is also assumed that the folder being shared has had the user that is being granted access to the share added under sharing / security and has had the read / write access enabled / disabled as appropriate

Print Friendly, PDF & Email

More Like This


Categories


Win 7 / 10 Tips & Tricks XP Tips & Tricks

Tags