Net Use with password and username

brunsodj

OSNN Addict
Joined
15 May 2002
Messages
103
Hey,

I was bored and decided to create a batch file that Maps a share that requires a username and password. I can't seem to find out the correct syntax for this.:confused:

I think it should look something like this:
net use H: \\computername\Sharename /USER:Username

What syntax do I use for automatically entering the password?
Is this right?


~Dan
 
C:\Documents and Settings\matt>net share \help
The syntax of this command is:


NET SHARE
sharename
sharename=drive:path [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents| Programs | None ]
sharename [/USERS:number | /UNLIMITED]
[/REMARK:"text"]
[/CACHE:Manual | Documents | Programs | None]
{sharename | devicename | drive:path} /DELETE

Doesn't appear to be such a syntax.
 
net use \\computername\sharename /user:username password

JJB6486
 
Thanks JJB6486,

That worked great. I also forgot to put the workgroup before my username.

~Dan
 
You dont need to put the workgroup in there. That is the DOMAIN name needed only if your connecting to a Win2k domain and using your Active Directory username/password. You dont need it when only on a workgroup.

JJB6486
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back