Discussion Locked

Mapping of shared folder from cmd prompt

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
how can i map shared folder on a domain by giving user name and password from command prompt,that is what is syntax of net use to map shared folder to include user nad and password from command line.

8 replies

by alpha-male

Here you go:

If your username and password are the same on the two computers:
net use h: \\machinename\drive$

(i.e. net use h: \\heineken\c$ )

where h: is the h drive on your machine, machinename refers to the machine you are trying to connect to, and drive is the drive letter on the machine you are trying to connect to.

If your username and/or password differ on the other machine:
net use h: \\machinename\drive$ /user:username

(i.e. net use h: \\heineken\c$ /user:administrator
The password or user name is invalid for \\heineken\c$

Type the password for \\heineken\c$:)

You then just type in the password as it requests.

If you want to map the first open drive letter on your machine:
Replace the h: with *

(i.e. net use * \\heineken\c$ /user:administrator
The password or user name is invalid for \\heineken\c$

Type the password for \\heineken\c$:)

You then just type in the password as it requests.
Note: If you want to connect to a Windows 95 machine, you do the exact same command line without the $

You can also do the same type of thing with Novell drives if you are logged into a Novell server:
For example, type

net use \\coefac\users\common

instead of the good old common k to getto the COMMON volume on COEFAC.

Hope this helps! Good luck...

by jaleel_mohammed

Thanks,for your reply ,i have a share name xyz on network which is accessed to only me,so when the user tries to access that share is will ask for user name and password,so i want to write a batch file to add net use comand,so that when the batch file is executed the user is able to access the shared folder xyz.i want single command line command which should incoperate both username and password.so that when this comand is executed share should get without asking user nad and password.

by jaleel_mohammed

i have a share name xyz on network which is accessed to only me,so when the user tries to access that share is will ask for user name and password,so i want to write a batch file to add net use comand,so that when the batch file is executed the useris able to access the shared folder xyz.i want single command line command which should incoperate both username and password.so that when this comand is executed share should get without asking user nad and password

by beermonster

Hi,

Try-

Net use \\server\share /user:serverordomainname\username password

IE the username, then a space, then the password. You should bear in mind that your users, if they can edit the batch file, are going to be able to see the username and password in plain text !!

by beermonster

Hi,

Try-

Net use \\server\share /user:serverordomainname\username password

IE the username, then a space, then the password. You should bear in mind that your users, if they can edit the batch file, are going to be able to see the username and password in plain text !!

This discussion is closed to new replies.