Drive mappings before log on.
Results 1 to 6 of 6

Thread: Drive mappings before log on.

  1. #1
    Member
    Join Date
    Sep 2004
    Location
    Netherlands
    Posts
    63

    Question Drive mappings before log on.

    I have a question regarding drive mappings and I wonder if any of you can help me.

    A developer of ours has written a script that copies some files of the K: drive (a drive mapping to another server) to a specific folder. The server is logged on and locked as a specific user and everything works fine.

    The thing I was wondering about is, what if there would be a power outage (for example) and the server reboots. The server would come up again and boot up to the logon screen. But would there at that point be a K: drive? Or will the (persistent) K: drive not be there until a user is logged on?

    I think not and I think that therefore the script would fail.

    Any thoughts on this?

    P.S.
    Obviously we would could argue about the way he has written his script, but I'm more curious about whether it would conceptually work...

  2. #2
    Master-Jedi-Pimps0r & Moderator thehorse13's Avatar
    Join Date
    Dec 2002
    Location
    Washington D.C. area
    Posts
    2,884
    How about this.

    Reboot the box, don't logon, and see if it works. This is the quickest and most reliable way to determine the answer since none of us have a copy of your script to see precisely what it does.

    --Th13
    Our scars have the power to remind us that our past was real. -- Hannibal Lecter.
    Talent is God given. Be humble. Fame is man-given. Be grateful. Conceit is self-given. Be careful. -- John Wooden

  3. #3
    Member
    Join Date
    Sep 2004
    Location
    Netherlands
    Posts
    63
    Ghe

    Although I can't actually do it with the box in question, I'll setup a test and try it.
    I was hoping someone could tell me at which point network drives would be set up by Windows so I would know whether it could be done.

    Anyway, I'll let you know, just in case anybody's interested

  4. #4
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Well, think about it.. The drive mapping will be made with the users credentials.. This means the user has to be logged on..

    Have the developer change the script so it uses UNC paths.. Schedule the script using the schedular.. Make the schedule run on an account with enough privileges to copy the files..
    No drive mappings needed and it would still work eventhough noone is logged on on the console..
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  5. #5
    You can't rely on drive mappings. They'll depend on what happens to be defined for the user whose context the script is running in.

    The script should be using UNC paths (\\servername\sharename\whatever). Alternatively, use "net use K: /d" and "net use K: \\servername\sharename" at the start to ensure that K: is what you expect.

  6. #6
    Member
    Join Date
    Sep 2004
    Location
    Netherlands
    Posts
    63
    Thanks for your replies.
    I've tested and confirmed what you all say... Drive mappings do not exist before logging on.

    I've passed the tip of using a UNC path on to the developer.

    Thanks again

Posting Permissions

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