Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

[RESOLVED] .DeleteFile not working

$
0
0
In a vbs, I have this sub to delete some files depending on the extension:

Code:

Sub DoDelete(TheFolder)

Dim TheFile
Dim FSO2

Set FSO2 = CreateObject("Scripting.FileSystemObject")

TheFile= TheFolder & "\*.xyz"

WScript.echo TheFile

On Error Resume next
FSO2.DeleteFile(TheFile), TRUE

Set FSO2 = Nothing

End Sub

WScript.echo TheFile tells me that TheFile is correct, it is something like this:
Q:\_X15\__KILLME Icons\*.xyz

But the FSO2.DeleteFile(TheFile), TRUE does not do anything.

Ideas?

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>