• Great article. 

    I was able to get everything to work except the actual deleting of files. Also, the log file is created but it does not show a list of deleted files, so this is consistant.

    Are these line supposed to be commented in:

    'Delete the files from the folder and log their names

      For m = 4 To UBOUND(arrFileList)

       'Call LogFileName(arrFileList(m).name & " " & cStr(arrFileList(m).DateLastModified))

        'objFSO.DeleteFile arrFileList(m)

      Next

    As a test,I commented them back in, but the delete did not work.

    When I try the suggestion from Grant Sutcliffe, I get an error on line # 64.

    Here is the command I'm using and there are (4) .bak files in it:

    DTSRUN /SUCEASQL /N"Purge Files by Number - DTS" /AgvFileMask:8=".bak" /AgvFolderPath:8="D:\Production\PROD\Developement\DeleteTest" /AgvLogPath:8="D:\Production\PROD\Developement\DeleteTest\Temp\DTSPurgeLog_Number.log" /AgvNumber:3=1 /E