Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Novell Map Network Drive Via Code
Message
 
 
To
01/07/2003 11:04:16
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00805445
Message ID:
00805728
Views:
52
Hi Kevin,

First, thanks for yoyur kind words.
Keep in mind that RemoveNetoworkDrive will generate an error if letter isn't mapped. You can use EnumNetworkDrives method to loop through existing network drives.
lcDriveLetter = "V:"
oDrives = oNet.EnumNetworkDrives()
FOR i=oDrives.Count-1 TO 0 STEP -2
  *? oDrives.Item(i-1), "-", oDrives.Item(i)
  IF oDrives.Item(i-1) = lcDriveLetter
    oNet.RemoveNetoworkDrive(lcDriveLetter)
    EXIT
  ENDIF
ENDFOR
>
> This is exactly what I needed. I have seen you on here helping a lot of people. I hope everyone really appreciates what you do for them, I know I do. One thing I would like to note in case someone else notices this and wants to know how to do this as well, is that it seems it will error if you try to map a drive to a different location if it is already mapped elsewhere. When using the Wscript.Network class, my autofill showed me there was a oNet.RemoveNetoworkDrive("DRIVELETTER") as well, so I guess it would be advisible to do this first to make sure the drive is clear before trying to map it elsewhere. Also, I guess the reason I selected Client/Server as the subject is because I will be initiating the code from client computers to connect to a network drive on the server.
>
>Thanks Again
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform