Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Find a filename
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00379476
Message ID:
00379904
Views:
29
I was thinking of RUN as a possibility too, but I hate using the RUN command. *s* One thing, though, Nadya said the file could be anywhere on the network, and the code below will only search on C:. You need to add a loop through all the drive letter, skipping drivetypes 1,2,5 and 6.

>
>Here is a very fast find - much quicker than using ADIR() recursively, etc. The only downside is the 'ugly' (VFP no longer in control) command shell !!
>
>
>*- File Ref: Test_Find_Pdf.Prg		&& Tested under NT4 WorkStation.
>CD C:\
>RUN /N2 cmd /c dir pdfmon.dll /s > c:\temp\results.txt
>CLEAR
>IF NOT FILE( "c:\temp\results.txt" )
>   ? "Unable to search local disk for Acrobat Writer."
>   RETURN .F.
>ENDIF
>
>cResults = FILETOSTR( "c:\temp\results.txt" )
>IF LEN( cResults ) > 100 AND "PDFMON.DLL" $ UPPER( cResults )
>   ? "PDFMON.DLL is present."
>   iPositionOfpath = ATC( "Directory of ", cResults ) ;
>                   + LEN( "Directory of " )
>   cPath = SUBSTR( cResults, iPositionOfpath )
>   iCharsToExtract = AT( CHR(13), cPath )
>   cPath = LEFT( cPath, iCharsToExtract )
>   ? "Path = " + cPath
>ELSE
>   ? "PDFMON.DLL is NOT present."
>ENDIF
>RETURN .T.
>
>
>Hope this helps.
>Houston.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform