Deleting a file is fairly simple in VBScript. First you’ll want to declare a File System Object so that you can interact with the file system. I’ve usually got a line near the top of my scripts
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Then you can delete a file easily using DeleteFile:
objFso.DeleteFile “C:\Temp\temp.file”
Advertisement