Net Use with password and username

Discussion in 'Windows Desktop Systems' started by brunsodj, Jun 20, 2002.

  1. brunsodj

    brunsodj OSNN Addict

    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
     
  2. madmatt

    madmatt Bow Down to the King Political User

    Messages:
    13,312
    Location:
    New York
    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.
     
  3. JJB6486

    JJB6486 Retired Mod Political User

    Messages:
    1,207
    Location:
    West Lafayette, IN, USA
    net use \\computername\sharename /user:username password

    JJB6486
     
  4. brunsodj

    brunsodj OSNN Addict

    Messages:
    103
    Thanks JJB6486,

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

    ~Dan
     
  5. JJB6486

    JJB6486 Retired Mod Political User

    Messages:
    1,207
    Location:
    West Lafayette, IN, USA
    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