February 21st, 2006, 03:37 PM
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?
Obviously we would could argue about the way he has written his script, but I'm more curious about whether it would conceptually work...
February 21st, 2006, 06:54 PM
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.
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
February 22nd, 2006, 06:49 AM
February 22nd, 2006, 09:34 AM
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..
Experience is something you don't get until just after you need it.
February 22nd, 2006, 01:20 PM
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.
February 22nd, 2006, 08:57 PM
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.