Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Map a Network Drive from a Static IP
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
00979011
Message ID:
00979040
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
cDriveLetter = "K:"
oFso = CreateObject("Scripting.FileSystemObject")
* Check if specified drive leter exists
? oFso.DriveExists(cDriveLetter)
...
* Get remote share name
oDrive  = oFso.GetDrive(cDriveLetter)
cShareName = oDrive.ShareName
...
* Enumerate all network drives
oNet = CreateObject("WScript.Network")
oDrives = oNet.EnumNetworkDrives()

FOR i=0 TO oDrives.Count-1 STEP 2
	? oDrives.Item(i), oDrives.Item(i+1)
ENDFOR
Check also Re: Determine Available Drives Message #841080 for alternative solution.


>Sergey,
> I have a couple of additional questions:
>
>1. How can I determine if the device name or drive letter is already in use?
>
>2. If in use how can I determine if the path is the path to my app?
>
>I am setting up our app to map a drive to the server if none exist during start up. This has become necessary due to the network configurations of some of our South american clients.
>
>Thanks a ton!
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform