Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Deleting all files in a directory
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00776809
Message ID:
00776812
Views:
31
>I have been reading the threads here on deleting all files from a directory and have some questions/concerns.
>
>The environment would be VFP 7 runtime with O/S W98, ME, 2000 and XP PRO.
>The specific problem that I have is with the file 'thumbs.db' which is a hidden file that has been added (on my XP PRO pc) to a subdirectory that contains .jpg's.
>
>If I use erase, the file is not deleted. If I use adir() the file is in the resultant array, but again does not delete. If I try to remove the 'hidden' attribute with 'run attrib -h filename.ext', the attribute is not removed.
>
>One of the recommendations suggested using Windows Script Hosting.
>But can't this feature be disabled and therefore my application would not function properly?
>
>Also, according to previous threads, it is optional in W98.
>
>Lastly, I am concerned about forcing the end user to install/enable Windows Script Hosting.
>
>Thank you in advance for any advice.

If the file is "open" or in use by some other program that's still active, you can't delete it. That's possibly what you're seeing.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform