"DIBS" <ma*@legs.com> schrieb:
What's the easiest way to rename all the files in a folder with entirely
new names starting with (say) 001?
The file type suffix to be retained as is.
Using VB2005 express edition.
Untested:
\\\
Dim FileNames() As String = Directory.GetFiles("C:\Bla")
For i As Integer = 0 To UBound(FileNames)
Rename( _
FileNames(i), _
Path.Combine( _
Path.GetDirectoryName(FileNames(i)), _
i.ToString("0000") & Path.GetExtension(FileNames(i)) _
) _
)
Next i
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>