Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

map drive based on computername

29 views
Skip to first unread message

luckymosen

unread,
Aug 2, 2007, 2:53:23 AM8/2/07
to
Hi Everybody, Can someone pls make a comment on the code below as to
why strServer does not get associated with the computername and
servername in the Case select. thanks.
++++++++++++++++++++++++++++++
Option Explicit
Dim StrServer
Dim s
Dim net
'On Error Resume Next
Set Net = CreateObject("WScript.Network")
s = Left(Net.ComputerName, 5)
Select Case s
Case "61syd" strServer = "61swfp5"
Case "61ade" strServer = "61adefp5"
End Select
'...and then we go on to
Net.MapNetworkDrive "x:", "\\strServer\faus_apps"

Derek

unread,
Aug 6, 2007, 2:37:52 PM8/6/07
to

the line that gets the computername will return the computer name in
all caps. The test you are using uses lower case letters in the
computername. If you change the case of the string in the Case
statement, or use the UCASE function, it should work just fine.

hth,
Derek
http://www.fortypoundhead.com
http://www.bwasl.com

0 new messages