Hi,
I have written a routine where I am scanning all hard drives for a certain folder (DCIM), so I can find out which drive is the flash card reader. This works quite nicely but I get an error message saying that the drive is empty for every drive that exists but, well ... is empty ... like empty CD-ROM drives or empty card reader slots. Is there a way to scan these without getting the error message?
here's the code:
FOR i := 4 TO 25 DO BEGIN
Chr := i + 64;
ImportDrive := FORMAT(Chr);
IF WinScriptHost.FolderExists(ImportDrive + ':\DCIM') THEN
ImportPath := ImportDrive + ':\DCIM';
END;
thanks!
Comments
Though if I choose a removable drive, or even CDROM and do IF NOT WshFSO.FolderExists('D:\DCIM') MESSAGE('Does not exist'); I don't get any errors even with empty media.
Take a look at the above options, you can identify removable drives and check if they are in a ready state prior to making the call. Obviously you wouldn't use messages, but those are the types.
Kevin
"Profanity is the one language all programmers know best."
For some strange reason I do not get these error-messages all the time. With the same codeunit, sometimes the empty drives are ignored, sometimes they produce error messages and I haven't found out why yet.
... because if I checked on a non existent drive with ISREADY I got another error message. Now it works like a charm ... thanks!