In a GWBasic program I wish to delete all files *.??8 in the working directory AND sub-directories. The 'Kill' command in GWBasic allows no switches and doesn't get into subdirectories. If I shell "del *.??8 /S" (or "del /S *.??8") I get the error message 'Invalid switch -/S'; even though 'del *.??8 /S' (or 'del /S *.??8') works from the DOS prompt. I am using WinXP with all updates. Can anyone tell me how to delete these files from within a Basic program?
Thanks.
kanga85
1
Newbie Poster
Recommended Answers
Jump to PostWrong forum.
GWBASIC doesn't have a recursive KILL command. You'll have to write a subroutine that does it yourself.
- Use FILES to get all the file names in the target directory.
- For each filename:
- if it is a directory (name is followed by "<DIR>", for example "C:\FOO\MYSUB<DIR>") then …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.