Article ID: 135818
Article Last Modified on 8/19/1999
x = DRIVETYPE(<expC>)
0 - Drive does not exist 1 - Drive has no root directory 2 - Floppy Disk 3 - Hard Disk 4 - Removable or Network drive 5 - CD-ROM 6 - RAM DiskThe DRIVETYPE function is included in FOXTOOLS.FLL. For more information on this function, please see FOXTOOLS.HLP in the VFP directory.
x = WNetGetConnection(lpszLocalName, lpszRemoteName, lpcchBuffer)
** BEGIN CODE SAMPLE
SET LIBRARY TO \VFP\FOXTOOLS.FLL & Register the FOXTOOLS Library
DECLARE INTEGER WNetGetConnection IN win32api ;
STRING lpszLocalName,;
STRING lpszRemoteName,;
INTEGER @ lpchBuffer && Declare the external WNetGetConnection ;
API function
slpRemoteName = SPACE(254) && Initialize variables
slen = LEN(slpRemoteName) && Initialize variables
FOR I = 1 to 26 && Loop through drive letters A thru Z
DRIVE = CHR(I + 64)
DTYPE = DRIVETYPE(drive) && Determine drive type
DO CASE
CASE DTYPE = 0 && Non existent drives
? "Drive " + DRIVE + ": does not exist"
CASE DTYPE = 1 && No root directory
? "Drive " + DRIVE + ": has no root directory"
CASE DTYPE = 2 && Floppy drives
? "Drive " + DRIVE + ": is a floppy drive"
CASE DTYPE = 3 && Hard drives
? "Drive " + DRIVE + ": is a local hard drive"
CASE dtype = 4 && Removable or network drives
iSuccess = WNetGetConnection(drive + ;
":",@slpRemoteName,@slen)
IF iSuccess = 0
? "Drive " + Drive + ": is a network" + ;
" drive connected to " + LEFT(slpRemoteName,;
ATC(chr(0),slpRemoteName) - 1)
ENDIF
CASE DTYPE = 5 && CD-ROM drives
? "Drive " + DRIVE + ": is a CD ROM drive"
CASE DTYPE = 6 && RAM drives
? "Drive " + DRIVE + ": is a RAM drive"
ENDCASE
ENDFOR
** END CODE SAMPLE
Additional query words: VFoxWin
Keywords: KB135818