'************************************** ' Name: *** Destroy a file without getti ' ng error! *** ' Description:This DOES use the kill fun ' ction, but when you use this it actually ' opens the file you want to destroy, clea ' ns it out, then deletes it so you don't ' get any error because of sensitive data! ' ' By: Matt Evans (from psc cd) ' ' ' Inputs:File To Delete ' ' Returns:No more file ' 'Assumes:Make sure not to delete win.com ' , win.ini, config.sys, himem.sys, autoex ' ec.bat or any of those files, lol ;D ' 'Side Effects:None '************************************** Sub DestroyFile(sFileName As String) Dim Block1 As String, Block2 As String, Blocks As Long Dim hFileHandle As Integer, iLoop As Long, offset As Long 'Create two buffers with a specified 'wi ' pe-out' characters Const BLOCKSIZE = 4096 Block1 = String(BLOCKSIZE, "X") Block2 = String(BLOCKSIZE, " ") 'Overwrite the file contents with the wi ' pe-out characters hFileHandle = FreeFile Open sFileName For Binary As hFileHandle Blocks = (LOF(hFileHandle) \ BLOCKSIZE) + 1 For iLoop = 1 To Blocks offset = Seek(hFileHandle) Put hFileHandle, , Block1 Put hFileHandle, offset, Block2 Next iLoop Close hFileHandle 'Now you can delete the file, which cont ' ains no sensitive data Kill sFileName End Sub