>What mean those values Returned by Win32API when I execute WNetAddConnection ?
>
>Declare integer WNetAddConnection in WIN32API string,string,string
>drive_letter = "G:"
>share_name = "\\boss500\"
The format of a share is \\
MachineName\
ShareName - you've omitted the sharename, so the WNetAddConnection() will inherently fail. You need to specify both parts of the UNC.
BTW, WNetAddConnction() is for backwards comaptibility to Win16; I'd strongly suggest using WNetAddConnection2() or WNetAddConnection3() instaed - it allows you to specify a userid, domain and password, offering better support,and permitting you to not force the share to map to a local resource, logging into the UNC without tying you to a mapped drive letter,
>z=WNetAddConnection(share_name, "", Drive_Letter)
>
>sometimes z = 1200, 85, 67 or 0
>
>Or using this other function:
>
>SET LIBRARY TO SYS(2004)+'FOXTOOLS.FLL' ADDITIVE
>
>LOCAL xaddconn, xh, xservidor, xletra
>xaddconn=RegFn('WNetAddConnection','CCC','I')
>
>share_name = "\\boss500"
>drive_letter = "G:"
>x=CallFn(xaddconn,share_name,"",drive_letter)
>? x
>
>I know that if I put (:) at the end of the drive letter
>the return value is diferrent.
>Must the drive letter for those function have the (:) at the end or not ?
>I'm asking because in Windows Script Host (Wscript) doesnt comes with the (:) at the end.
>I havent found what the return values of WNetAddConnection mean.
>
>Sample:
>ONET = CREATEOBJECT("WScript.Network")
>oNetDrives = ONET.EnumNetworkDrives
>FOR lni = 0 TO oNetDrives.COUNT - 1 STEP 2
> ? oNetDrives.ITEM(lni)
>ENDFOR
>
>and oNetDrives.ITEM(lni) returns => "\\BOSS500\E" without (:)
>Does it makes difference if Win is 9x, ou Win2K ?
>
>Thank's in Advance