Results 1 to 6 of 6

Thread: How to set username and password in a logon batch file?

  1. #1
    Moderator YeOldeStonecat's Avatar
    Join Date
    Jan 2001
    Location
    Somewhere along the shoreline in New England
    Posts
    50,445

    How to set username and password in a logon batch file?

    I have a situation where I wish to use the net use command to map some network drives to a server running a domain.

    net use O: \\servername\sharename

    The logon.bat sits locally on the computer, with a shortcut in the startup folder. Upon reboot and logging onto the workstation locally (workgroup logon), the DOS box appears like normal to run the drive mapping scripts. But on the first map attempt...it prompts for a username and a password..at which point you type it into the DOS box...and it then completes the mapping.

    Cannot set these computers to log into the domain like normal...else I'd be doing that already.
    MORNING WOOD Lumber Company
    Guinness for Strength!!!

  2. #2
    Advanced Member hoov's Avatar
    Join Date
    Jan 2001
    Posts
    571

    From net use /? I got this- hope it helps

    NET USE [devicename | *] [\\computername\sharename[\volume] [password | *]]
    [/USER:[domainname\]username]
    [/USER:[dotted domain name\]username]
    [/USER:[username@dotted domain name]
    [[/DELETE] | [/PERSISTENT:{YES | NO}]]

    NET USE {devicename | *} [password | *] /HOME

    NET USE [/PERSISTENT:{YES | NO}]




    NET USE J: \\servername\share /USER:domainname\username password

    where
    servername = the name of the server
    share = the name of the share
    domainname = the name of the domain where the username is defined
    username = the username
    password = the password

  3. #3
    I was hoping someone could help you here YOSC, networking with a server is still a bit beyond my scope. But since I had some free time I searched all over for answers to your question. I hope some of this can at least point you in the right direction.

    "Before a user can connect (using the NET USE command) to their User Home Directory on a server machine, they must first log on using the NET LOGON command." http://www.email.ie/~trish/manual/chap3-17.htm#C317

    eg: NET LOGON username password


    The Net Command Reference
    http://www.email.ie/~trish/manual/chap3-35.htm#C335

    I could be way off base, I'm not sure, but at the bare minimum I learned 'something' today

    [edit] Hoov, glad to see you posted. I must have been typing my post as you posted. Looks like the problem is solved. [edit]

  4. #4
    Moderator YeOldeStonecat's Avatar
    Join Date
    Jan 2001
    Location
    Somewhere along the shoreline in New England
    Posts
    50,445
    Norm, so glad to see you back!

    Twas another co-worker who asked me this question. Odd setup, I'll pass this onto him and see if it gets the job done.

    OK, the setup he's faced with...not by his choice, is a cheap office which ran out and bought several HP Pavilion's (yuck). He's asking me where the heck it is in WinXP to set to log into a domain (Win2K Server there running AD) ...I'm saying right click my computer, properties, yada yada to where you assign computer name/workgroup/domain...he's been here before. Nope, can't find it. After a few minutes..it hits me...HP Pavilion...oh no...WinXP HOME you must be facing. Doesn't log into a domain.

    So I walk him through making sure the local log on is the same as the domain account username and password...and making a local logon batch file to map the drives....since things usually work fine with this "workgroup setup". But still the drive mappings request a logon to the server....curiously enough. I guess XP Home still doesn't tell the server who logged on locally...like the PWL.

    So anyways, will see if this works.
    MORNING WOOD Lumber Company
    Guinness for Strength!!!

  5. #5
    Advanced Member hoov's Avatar
    Join Date
    Jan 2001
    Posts
    571
    Couple of links for Win XP home logging onto a domain:


    http://www.wown.com/j_helmig/wxphdoms.htm


    http://www.neowin.net/comments.php?id=3216

  6. #6
    Good links there hoov, I saw those as I was looking for an answer yesterday. Didn't think much of them at the time, I was assuming the client was an NT or 2K box.
    XP Home on a office network? The name "Home" should have given them a clue.

    MS seems to discourage the use XP home logging into a domain. There's more money in XP Pro. Actually removed the option in XP home. But it appears there is a work around in those links.
    TweakUI may be an easy answer if you can find, or have a copy.
    I have a spare

    I've worked on quite a few HP PC's and I would never buy one myself. Power supplies die frequently from what I've seen, all in one mobo's fall apart piece by piece, and fans don't seem to last long either. I just got done replacing a power supply, CPU fan, and video card in a 3 year old HP. Onboard video, with only 2 PCI slots. No spare slot to add a sound card that was needed, as the onboard was fried. For what I had to charge the lady, she could have bought a decent used machine. It's only a matter of time before a mobo replacement will be necessary. It seems that once one piece goes, the rest follow in a domino effect (in around the 2-3 year mark).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •