NET USE logon script

Discussion in 'Home Networking' started by Tx2, Mar 11, 2007.

  1. Tx2

    Tx2 Guest

    I'm trying to set up a logon script using GPEDIT.MSC on a Windows XP Pro
    (media centre edition) but i'm not on a domain, just a workgroup.

    I need to map a drive on my other PC which is acting as a file server,
    and UI want this to run in a script at logon.

    thus far, I have created a .bat file which has been placed in C:\WINDOWS
    \System32\GroupPolicy\User\Scripts\Logon and contains the following

    net use n: \\OtherPC\MyFiles\

    .....but I can't get it to run!

    It shows up in the script logon properties of GPEDIT, so it's definitely

    The other PC has an account on it with the credential for this PC (I
    also have network shares on the other PC which are restricted to just me
    accessing them from this machine) so do I need to set up a password?

    Maybe I'm going about it all the wrong way... help?
    Tx2, Mar 11, 2007
    1. Advertisements

  2. Tx2

    Simon Dobson Guest

    There should be no trailing \
    Simon Dobson, Mar 11, 2007
    1. Advertisements

  3. Tx2

    Tx2 Guest

    of , felt we'd be interested in the

    Tried with, and without - no success :-(
    Tx2, Mar 11, 2007
  4. What happens if you type this command in a DOS prompt after Windows has
    started - does it work OK or does it give an error message.

    Why do you need to connect using logon script rather than configuring it in
    Windows Explorer "Map Network Drive"?
    Martin Underwood, Mar 11, 2007
  5. Tx2

    Tx2 Guest

    of , felt we'd be interested in the following...

    "Logon failure: unknown user name or bad password."

    So it is going to require my account username and password?
    Not too happy about this being in a .bat file...

    I know I can wildcard the password for a prompt, but that defeats the
    I don't. I'm just trying an alternate method, mainly in part because I
    am embarking on installing Server 2000 soon in preparation for an even
    bigger project I'm undertaking in the near future


    I will be 'mucking' about with domains, active directory and so on. I
    want to get a few scripts running first.
    Tx2, Mar 11, 2007
  6. create an account on each PC with the same username (and maybe same
    Martin Underwood, Mar 11, 2007
  7. Tx2

    David Wade Guest

    You may need to put it in the user section....
    David Wade, Mar 11, 2007
  8. Tx2

    Mike Sun Guest

    or try the syntax:-

    net use s: \\servername\sharename /u:username password

    Cheers from Mike
    Mike Sun, Mar 12, 2007
  9. Tx2

    Tx2 Guest

    of , felt we'd be interested in the following...

    That has been done as a matter of course anyway due to some shares
    already in place.
    Tx2, Mar 12, 2007
  10. Tx2

    Simon Dobson Guest

    There wouldn't be with a trailing \ :)

    As other posters have pointed out (and as the error message shows you
    missed from your first post!), this is permissions related. Check you've
    identical accounts set up on both PC's, and that share/file permissions
    are as they should be.
    Simon Dobson, Mar 12, 2007
  11. Tx2

    Tx2 Guest

    of , felt we'd be interested in the

    Managed to resolve it!

    The problem was, the folder was called one thing, but the share name was
    called something else!

    My fault, as i did amend the name when making the share, and of course,
    this was put out of my mind when putting the .bat file in place.

    I've now amended the .bat to give the share name, whereas it was
    referencing the folder name....

    The only issue I now have, is that my network drive can't be connected
    at logon because it's connecting wirelessly.... I can deal with a
    balloon tip telling me this though, especially as I will sometimes be
    connecting onto my wired network!

    Unless anyone knows a workaround.... :)
    Tx2, Mar 12, 2007
  12. Tx2

    Devs Guest

    Use the windows wireless zero drivers rather than 3rd party ones. These
    link and connect before log on. If you're moving on to AD this will save
    you a lot of headaches.
    Devs, Mar 13, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.