Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Net Use to map a drive?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00146250
Message ID:
00146487
Views:
21
>>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)
>
Ed,

Thats great! I'm mapping paths using Novell 3.12 and the above can prove to be extremely helpful when testing on my local machine and not connected to the server.

Rboert
Previous
Reply
Map
View

Click here to load this message in the networking platform