Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there an API or VFP function to map a directory?
Message
De
05/01/2000 12:57:31
 
 
À
05/01/2000 12:38:48
Paul De Niverville
Deniverville Econometric Research Ltd.
Victoria, Colombie Britannique, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00313316
Message ID:
00313336
Vues:
29
>I need to test if a directory on a server is mapped to the local client workstation and if it is not, I want to create the mapping.
>
>For example does my S: drive on the client point to \\MANTIS\public\IMPORT\ on the server.
>
>If not, create an S:drive and point to the above server directory.
>

The UNC assigned to a mapped drive can be retrieved using the Win32 API; I have sample code in the FAQ entry #522 How do I determine the UNC for a mapped drive?

Drive mapping can be done using WNetAddConnection3; there's a sample in my NETSOURCE class, downloadable as file #9502 NETRESOURCE structure class - this relies on my CLSHEAP class, also available in the files section.

If the drive mapping is incoprrect, you need to use WNetCancelConnection2() to release the drive mapping.

The Windows Script Host's Wscript.Network automation object can accomplish these tasks as well, and offer added functionality as well. I'd seriously consider usign the WSH's automation objects rather than the API; you can download detailed inforamtion on the WSH from msdn.micrsooft.com/scripting
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform