Const ForReading = 1
Hey I got a problem deleting files. I wrote a script to delete files, heres how it works…
It reads a txt file that contains a folder path in each line then attemps to delete the files in the folder. It works great wtih the exception of files that the name is to long. It just skips these like they dont exist. Also even though I have on error resume next enabled it wants to loop into its self forcing the script to never end.
Any ideas on how to fix this… heres what I have so far.
Set objTextFile = FSO.OpenTextFile (“Files to be Deleted.txt”, ForReading)
Do Until objTextFile.AtEndOfStream
NextLine = objTextFile.Readline
Set Fol = FSO.GetFolder(NextLine)
For Each File in Fol.Files
FSO.DeleteFile File.path, True
Next
Loop
On error GoTo 0