Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete a directory and all its files
Message
From
07/11/2004 20:13:22
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
06/11/2004 23:05:20
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00958848
Message ID:
00959034
Views:
14
>>>Hi
>>>
>>>Is there a command to delete a Directory also if it is not empty?
>>>
>>>Tank you in advance for the help.
>>>Luigi
>>
>>Another option is to use the DOS command, DELTREE.
>
>DELTREE is not available in all DOS versions (at least my copy of XP doesn't recognize it). A DOS solution which is probably more universal is
>
lcDir = "Directory Name"
>RUN RD &lcDir /S /Q
I am afraid that isn't quite universal enough, either - here with Windows 98, neither the /S nor the /Q option is valid.

Some suggest WSH, but that isn't guaranteed to be installed in all cases. API is perhaps more universal; I am not sure there are specific differences, in this case, between the major operating systems.

You might also write a UDF in VFP: use recursion; and while you're at it, you might just as well "re-curse" (curse over and over again again), at having to use such a solution for such a simple-looking problem...
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform