-
umm
Q: How would one(me) go about coding to WIPE(ala title not delete) a file(in VB6), i would imagine there might be an api call(i hope), i just dont know what it is so any help would be highly apreciated =)
A: Thats ur job duh!!!
Anyways thx in advance.
-
-
find out the length of the file you want to get rid of (the term you are looking for is "shred") and then overwrite it with an equal amount of zeroes, then delete it in the normal way, no trace of the original should be left behind. Or thats the way it seems to me.
If anyone knows another better way, then i'll stand corrected :)
-
Aha!
If that's called Wipe then:
Code:
Open File for output as #1
Close #1
Kill File
-
just adding alittle to the definition of shred / wipe...
you need to ensure when you write over the file with new data that you write over the exact same place on the hard disk (sectors,clusters,tracks,whatever).
if (and in windows its very common) the file is broken into different parts on the harddrive you need to locate every part and overwrite it.
i dont know for sure, but if you just write over the file in windows, its possible that windows will just create a whole new file location on the harddrive and just change the (FAT entry) i think.
i think the best way is to use low level disk writing commands (probabily not in vb) a .com file might work if you can make one.
i hope this helps.
-
I got this code from Matthew Gates a while ago... I modified it a bit (it's stated it's only save when you overwrite it 7 times or something :confused: )
Code:
Sub TerminateFile(sFileName As String)
Dim Block1 As String, Block2 As String, Blocks As Long
Dim hFileHandle As Integer, iLoop As Long, offset As Long
Dim x As Integer
'Create two buffers with a specified 'wipe-out' characters
Const BLOCKSIZE = 4096
Block1 = String(BLOCKSIZE, "X")
Block2 = String(BLOCKSIZE, " ")
'Overwrite the file contents with the wipe-out characters
hFileHandle = FreeFile
For x = 0 To 6
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
Next x
'Now you can delete the file, which contains no sensitive data
Kill sFileName
End Sub