Hola.
Estoy armando mi nueva App "Shredder" para poner en practica lo que aprendi de como funciona un hdd y como borra windows.
Asi que esto, no va a hacer que el archivo desaparezca del disco. Pero cando lo encuentres no va a servir ni para jugar con tierra
PD: Si alguien tiene idea de como ****** hago para verificar si un proceso tiene abierto mi querido archivo. Que se ponga en contacto
'---------------------------------------------------------------------------------------
' Module : mShred
' Author : Elemental Code
' Date : 21/04/2011
' Purpose : Delete a file safer than windows.
'---------------------------------------------------------------------------------------
Option Explicit
Public Function Shred(ByRef sPath As String, Optional lLoops As Long = 1) As Boolean
Dim Data() As Byte
Dim DataCero() As Byte
Dim DataRandom() As Byte
Dim i As Long
Dim fLen As Long
On Error GoTo error_Sub
SetAttr sPath, vbNormal
fLen = FileLen(sPath)
ReDim Data(fLen) As Byte
ReDim DataCero(fLen) As Byte
ReDim DataRandom(fLen) As Byte
For i = 0 To fLen - 1
Data(CInt(i)) = &HFF
DataCero(CInt(i)) = &H0
If i Mod 2 = 0 Then
DataRandom(CInt(i)) = &H0
Else
DataRandom(CInt(i)) = &HFF
End If
Next i
For i = 0 To lLoops
Open sPath For Binary Access Write As 1
Put #1, , Data
Close #1
Open sPath For Binary Access Write As 2
Put #2, , DataCero
Close #2
Open sPath For Binary Access Write As 3
Put #3, , DataRandom
Close #3
Next i
Kill (sPath)
Shred = True
Exit Function
error_Sub:
Shred = False
End Function
PD: Si alguien me explica como funciona el comando Freefile para no tener que usar numeros, se lo agradezco