Wednesday, February 9, 2011

Script to Delete a file from system

'Delete file
On Error Resume Next
dim objFSO

'specify filename and path for file to create
strFile="c:\file.txt"

set objFSO=CreateObject("Scripting.FileSystemObject")
'to force deletion, set to TRUE otherwise set to FALSE
objFSO.DeleteFile strFile,TRUE





No comments: