*FUNCTION ConnectDrive LPARAMETERS LocalDriveLetter, RemoteName, CurrentUserPassword *************** * Param: * LocalDriveLetter = letter to assing to the connection * RemoteName = sharename of the directory to be mapped (\\server\drive) * CurrentUserPassword = optionnal,if differ from the local password * *************** *!* DWORD WNetAddConnection( *!* LPTSTR lpszRemoteName, // address of network device name *!* LPTSTR lpszPassword, // address of password *!* LPTSTR lpszLocalName // address of local device name *!* ) DECLARE DOUBLE WNetAddConnection IN MPR.DLL ; STRING @ lpszRemoteName,; STRING @ lpszPassword,; STRING @ lpszLocalName IF LEN(LocalDriveLetter) = 1 LocalDriveLetter=LocalDriveLetter+':' ELSE LocalDriveLetter=SUBSTR(LocalDriveLetter,1,1)+':' ENDIF IF TYPE('CurrentUserPassword') = 'L' CurrentUserPassword=.NULL. ENDIF IF !DIRECTORY(LocalDriveLetter+'\') ? WNetAddConnection(@RemoteName,@CurrentUserPassword,@LocalDriveLetter) ENDIFHTH :-)