Information générale
Catégorie:
Fonctions Windows API
>>You can map a network *share* to a drive letter with WSH using the MapNetworkDrive method. objNetwork.MapNetworkDrive(strLocalDrive, strRemoteShare, [persistent], [strUser], [strPassword])
>>
>>But I want to map a network *folder* to a drive letter.
>>You can do it from Windows Explorer by highlighting the folder and clicking Easy Access > Map as Drive.
>>You can also do it from the command line with NET USE because it allows you to add a "volume" to form the complete path that you want to map "\\ComputerName\ShareName\Volume"
>>--> net use [{devicename | *}] [\\computername\sharename[\volume] [{password | *}]] [/user:[domainname\]username] [/user:[dotteddomainname\]username] [/user:[username@dotteddomainname] [/home {devicename | *} [{password | *}]] [/persistent:{yes | no}] [/smartcard] [/savecred] [/delete] [/help] [/?]
>>
>>Is there a windows-native way to do this?
>
>Is this to be mapped from within an application?
>
>If yes, I do not recall the last time I used drive letter as is from within an application. There is just too many factors which could make it no longer workable. I always use fully qualified UNC approach, which is used from a global application property, for example, and that would always work.
Good suggestion but for compatibility with previous code I need a letter.
Thanks
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement