Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Map Drive Letter
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01100869
Message ID:
01100877
Views:
15
I see now that this is looping through the drive letter to see which drive is used for a specific path. The Subject line of the post threw me. Found two posts for drive letter mappings. The Server is not a Novell server. Actually I do not even know, maybe Win2003, NT, hard to say. Will the first example work for a non-Novell?
oNet = CREATEOBJECT("Wscript.Network")
oNet.MapNetworkDrive("V:", "\\Server\Volume\dir", .F.)
Declare integer WNetCancelConnection in WIN32API String lpName,short lForce
Declare integer WNetAddConnection in WIN32API ;
  string lpRemoteName,  ;
  string lpPassword,  ;
  string lpLocalName
?WNetAddConnection("\\server_name\map_dir", "", "L:")
?WNetCancelConnection("L:",0)
>I want to map Z:\ to \\GA016FT3\RT2006\tempdbfs\ folder. I found this code on a previous thread, but in the debugger I can not understand how it maps a new drive.
>
>
>
>lcDrv = " "  && Network Drive
>
>DECLARE INTEGER WNetGetConnection IN win32api ;
>	STRING lpszLocalName,;
>	STRING lpszRemoteName,;
>	INTEGER @ lpchBuffer && Declare the external WNetGetConnection API
>function
>slpRemoteName = SPACE(254)  && Intialize Variables
>slen = LEN(slpRemoteName) && Intialize Variables
>FOR I = 1 to 26 && Loop through drive letters A thru Z to identify onnections
>	DRIVE = CHR(I +64)
>	DTYPE = DRIVETYPE(drive) && Determine drive type
>	IF dtype = 4 && Removables or network drives
>		iSuccess = WNetGetConnection(drive + ":",@slpRemoteName,@slen)
>		IF iSuccess = 0
>***			lcSrvarea = LEFT(slpRemoteName,ATC(CHR(10),slpRemoteName) - 1)
>			lcSrvarea = LEFT(slpRemoteName,AT(CHR(0),slpRemoteName) - 1)
>			IF UPPER(lcSrvarea) = "\\Server\srvr_area"
>				lcDrv = DRIVE
>			ENDIF
>		ENDIF		
> 	ENDIF
>ENDFOR
>
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform