Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Re mapping via foxpro
Message
 
To
04/10/2001 10:11:03
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00564113
Message ID:
00564165
Views:
22
This message has been marked as a message which has helped to the initial question of the thread.
>either way...

The easiest way (and the one I'll demonstrate here) is to use the Windows Script Host's WScript.Network object.
oNet = CREATEOBJECT('WScript.Network')
oDrives = oNet.EnumNetworkDrives()
* Get the drive and server/share
FOR lni = 0 TO oDrives.Length - 1 STEP 2
  ? "Drive " + oDrives.Item(lni), "Server/Share " + oDrives.Item(lni + 1)
NEXT
* Map a drive using the current user/password
oNet.MapNetworkDrive("F:", "\\server\share") && There are other optional parameters
* Disconnect
oNet.RemoveNetworkDrive("F:")
Additional information may be found in the series of articles that Ed Rauh and I wrote in the VFUG newletter beginning Sept. 2000. The one covering this object appeared in the December issue. It's available on-line at www.vfug.org.

If the WSH isn't available, let me know and I can post API code that does the same thing.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform