
Mapping Drives Permanently
Quick Question, I have searched around, but can't seem to find the answer.
I have a script that unmaps the old network drives, and maps them to a new
server. Same dir's just different server name. We want this new drive
mapping to be permanent, but whenever I reboot, the old mapping shows up
again. We do not want the script to be run every time, just a run once on
each machine, and then discard.
Here is what I have.
Set oNet = CreateObject ("Wscript.Network")
oNet.RemoveNetworkDrive "G:"
oNet.RemoveNetworkDrive "H:"
oNet.RemoveNetworkDrive "I:"
oNet.MapNetworkDrive "G:" "\\NewServer\Dir1"
oNet.MapNetworkDrive "H:" "\\NewServer\Dir2"
oNet.MapNetworkDrive "I:" "\\NewServer\Dir3"
From what I can understand about the little bit I do understand, what this
does (I patched it together from bits and pieces I found, sorry if I have
plagiarized anyone, but it is the best way to learn). is removes the prior
drive mappings, and then connects to the new mappings, but when I reboot,
the old mappings remain & I need them to be permanent. I did see one script
that had a ,true,, kinda thing after the MapNetworkDrive but I could not get
it to work.
As well, is there an errorlevel or somesuch as some of the computers have a
J directory that we want unmapped permanently, but when I run it on a
machine that does not have the J mapped, it spits out an error and stops.
Thank you ever so much in advance for any help you may give.
BTW all Machines running Win98Se, with WSH 5.6