Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Net Use to map a drive?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00146250
Message ID:
00146475
Vues:
34
>>Is there an API to map a Windows NT network drive letter? Similar to the NET USE dos prompt command.
>
>In addition to the API stuff mentioned by others, the Windows Scripting Host (native to 98, and addable to other operating systems by running the self-installing WSH.EXE available from Microsoft's Web site) provides a network automation object. If WSHOM.OCX has been registered, the following works:
>
>
>oWshNet = CREATEOBJ('Wscript.Network')
>*  Lots of arguments available here:
>*  cLocalDrive is the local resource name (eg 'N:')
>*  cRemoteName is the UNC of the path you want to map
>*  (optional)  lUpdateProfile (bool) if .T., save the mapping
>*  (optional)  cUserId the name of a user other than the default
>*              Windows Login userid for accessing UNC
>*  (optional)  cPassword password for user accessing UNC
>oWshNet.MapNetworkDrive(cLocalDrive, cRemoteName)
>*
>*  You can unmap a drive by:
>*
>oWshNet.RemoveNetworkDrive(cLocalDrive)
>
Here's some more scripts that might be useful at:

http://cwashington.netreach.net/site/scripts/scripts_index.html
John Harvey
Shelbynet.com

"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform