Question

Locked

How do pass user credentials with net use command?

By steak1986 ·
I am trying to create a batch file that will Create a daive mapping when the computer starts up. First I will tell you I have tried the gui's way of mapping a network drive, I tell it to remember the credentials, but it always forgets the password. I have also tried the net use /savecred(entials). My batch file is posted below, I can get it to all work except when i try to push along the password. the problem I am having is that the directions on the internet dont have an example of the password switch being used. From what I have read the switch is [password| *] everytime i enter it tells me that my password, or whatever is in that spot either my password or *, is not a recognizable internal command.


@echo off
net use /delete w: >nul
net use w: \\(server)\lantalk password:***** \user:*****
exit

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

just a little off

by scott_heath In reply to How do pass user credenti ...

net use <driver letter> \\<servername>\<sharename> /user:<username> <password>

Example:

net use w: \\myserver\fileshare /user:MyID MyPassword

I use this in more than one batch file.

Collapse -

re:How do pass user credentials with net use command?

by brhy In reply to How do pass user credenti ...

net use z: \\servername\folder /user:username password

Collapse -

re:How do pass user credentials with net use command?

by brhy In reply to How do pass user credenti ...

net use z: \\servername\folder /user:username password

by: Bryan Dalawangbayan 1/20/11

Collapse -

Can specify domain name, and prompt for password

by Brooks.B.J In reply to How do pass user credenti ...

(At least on Windows 7), you can specify your domain name on the command line, and also get it to prompt you for your password. For example:

net use x: \\server\fileshare /user:domain\username *

The asterisk prompts for the password, which does not get echoed on-screen. Better than having text passwords in command files...

Back to Networks Forum
5 total posts (Page 1 of 1)  

Hardware Forums