Re: Mapping drives
- From: "Buddy Greenshield" <gcsbend-at-bendcable-dot-com>
- Date: Wed, 13 Apr 2005 23:05:36 -0700
If you're using vbscript to map the drives, first test to see if it's
already mapped to the correct share, if it is, continue. If it's not, remove
the mapping and remap. Use this code for each drive you need to map.
Example:
Dim oNet, oDrives
Set oNet = WScript.CreateObject("WScript.Network")
Set oDrives = oNet.EnumNetworkDrives
For i = 0 to oDrives.Count - 1 Step 2
If oDrives.Item(i) = "T:" Then
If oDrives.Item(i+1) = "\\sbsComputer\ShareName" Then
Continue with your script here...all is well
Else
oNet.RemoveNetworkDrive "T:"
oNet.MapNetworkDrive "T:","\\sbsComputer\CorrectShareName"
Continue with your script...the mapping has been corrected
End If
End If
Next
oNet.MapNetworkDrive "T:","\\sbsComputer\CorrectShareName"
Continue with your script, It wasn't mapped, but now it is.
Buddy G
"dwight" <dwight@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A1D90A17-6204-43FB-A2BE-1DF5E5685DDB@xxxxxxxxxxxxxxxx
>
>
> "Steve Stogrin" wrote:
>
> > use GPO I posted information about this over a year ago.
> >
> >
http://groups.google.ca/groups?hl=en&lr=&th=b244aab1080db64c&seekm=ezNu7kNPEHA.3020%40tk2msftngp13.phx.gbl&frame=off
> >
>
> That is how I'm currently doing it, based on your post. Just thought there
> might be an easier way.
>
> If a user already has that particular drive mapped, the user gets a
vbscript
> error when logging in. How does one correct that problem?
>
> Thanks.
.
- Follow-Ups:
- Re: Mapping drives
- From: Dwight
- Re: Mapping drives
- References:
- Mapping drives
- From: dwight
- RE: Mapping drives
- From: Joe K
- RE: Mapping drives
- From: dwight
- Re: Mapping drives
- From: Steve Stogrin
- Re: Mapping drives
- From: dwight
- Mapping drives
- Prev by Date: Re: Connect member server to SBS2003.
- Next by Date: Re: Getting internal domain noticed to the outside world
- Previous by thread: Re: Mapping drives
- Next by thread: Re: Mapping drives
- Index(es):
Relevant Pages
|