>Hi all,
>I have used an API function to map a network drive and it works nicely when run on Win9x. However, it fails on Windows2000.
>The function I used (see below) appears to be a 16 bit API call. Has anyone had any luck implementing this on Windows2000? Or, some other alternative?
>
>FUNCTION ConnectToDrive
>PARAMETERS tcPath, tcPassword, tcDrvLetter
>
> PRIVATE ALL LIKE j*
> jcPath = tcPath
> jcPassword = tcPassword
> jcDrvLetter = tcDrvLetter
>
> DECLARE Integer WNetAddConnection IN Win32api string, string, string
>
> jnConnected = WNetAddConnection(jcPath, jcPassword, jcDrvLetter)
>RETURN IIF(jnConnected = 0, .T., .F.)
>
>Thanks!
I've used similar code to map network drives on Win9x and 2L without problems. First, what's the value of the jnConnected? Second, under Win2K the Windows Script Host is available and can be used in order to do what you're doing now with less code.
George
Ubi caritas et amor, deus ibi est