Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Net use vs visual foxpro
Message
 
To
02/03/2004 11:39:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00882363
Message ID:
00882370
Views:
13
>Hi,
>
>I've a question : for the moment we are using 'net use' to make a connection from a client to a server(drive) when the user is logging on to windows.
>
>But sometimes it happends that the 'mapped drive' is gone for some reason. Now i'm wondering if it's possible to connect to a drive on a server and give it a name like (F) without using the 'run' command so that the user doesn't get a black window.
>
>
>Thnx

The late Ed Rauh provided an example using the WNetAddConnection3() API call that should be available either in the FAQ section or the downloads. You may also be able to use WNetAddConnection()
DECLARE INTEGER WNetAddConnection IN Win32API;
 STRING @lpszRemoteName, STRING @lpszPassword, STRING @lpszLocalName
* lcserver is the share\volume
* lcdrive is the drive specifier
lnresult = WNetAddConnection(@lcserver, 0, @lcdrive)
IF lnresult = 0 THEN
  * Success
ENDIF
Additionally, if it's available, the Windows Script Host's WScript.Network object has this sort of functionality.
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform