Hello,
"JasonP" <(E-Mail Removed)> schrieb:
> I want to write a sub that will accept a folder parameter (string, as in:
> "C:\Temp") and then delete all the files in that folder. Can anyone tell
me
> what a simple way to accomplish this is? I don't see an obvious method for
> the Directory object; I assume I could get the file list for the Directory
> and then explicitly delete each file, but is there a single-command
method?
\\\
Dim s As String
For Each s In System.IO.Directory.GetFiles("C:\WINDOWS\TEMP")
System.IO.File.Delete(s)
Next s
///
-- or --
The BASIC way:
\\\
Kill("C:\WINDOWS\TEMP\*.*")
///
HTH,
Herfried K. Wagner
--
MVP · VB Classic, VB .NET
http://www.mvps.org/dotnet