Scanning all Hard-Disk's for files ( with sample )
Posted: Sat Jul 26, 2008 9:54 am
Hello,
here is a tool, _ all Hard-disks for defined files.
After a problem with Microsoft
( with a automatic-update of VISTA, i got a corrupt DVD-driver
for my SONY-RW ) with that, the function aDrives( 2 ) didn't work
and i had to test on a different computer.
maybe you can need it
Best Regardes
Uwe
here is a tool, _ all Hard-disks for defined files.
After a problem with Microsoft
( with a automatic-update of VISTA, i got a corrupt DVD-driver
for my SONY-RW ) with that, the function aDrives( 2 ) didn't work
and i had to test on a different computer.
Code: Select all
#include "fivewin.ch"
PROCEDURE Main()
// aDrives( [<nType>] ) --> aDrives
// This function Returns an array with all the units valid of our system.
// Parameters:
// <nType> 0 = All drives (default), 1 = Floppy drives only, 2 = Hard drives only
aResult1 := {} // Borland
aResult2 := {} // Harbour
aResult3 := {} // FWH
lResult1 := .F.
lResult2 := .F.
lResult3 := .F.
aDrive := aDrives( 2 ) // scanning of harddisks
FOR i := 1 TO LEN ( aDrives( 2 ) )
cDrive := aDrive[i] // scanning drives
msgalert( "Seek in Drive : " + CRLF + ;
cDrive, "Drive" )
aFindFile( "BCC32.exe", "&cDrive", aResult1 )
// <cFileName> File to search.
// <cPath> Path of beginning of the search.
// <aResult> Array where the result of the search will be stored.
IF !empty( aResult1 ) .and. lResult1 = .F.
lResult1 := .T.
// Returns the complete Path of BORLAND
msgalert( aResult1[1], "BORLAND found" )
ENDIF
aFindFile( "HARBOUR.exe", "&cDrive", aResult2 )
IF !empty( aResult2 ) .and. lResult2 = .F.
lResult2 := .T.
msgalert( aResult2[1],"XHARBOUR found" )
ENDIF
aFindFile( "FIVEH.lib", "&cDrive", aResult3 )
IF !empty( aResult3 ) .and. lResult3 = .F.
lResult3 := .T.
msgalert( aResult3[1],"FWH found" )
ENDIF
IF lResult1 = .T. .and. lResult2 = .T. .and. lResult3 = .T.
MsgAlert( "Scanning of : " + CRLF + ;
"BORLAND, xHARBOUR and FWH finished !","Attention" )
// all files found, finished scanning
EXIT
ENDIF
NEXT
Return( NIL )
Best Regardes
Uwe