Red de conocimiento informático - Problemas con los teléfonos móviles - Código VB para borrar todos los rastros del historial de Internet

Código VB para borrar todos los rastros del historial de Internet

Opción explícita

Private Sub Command1_Click()

Dim strPathName As String

strPathName = ""

strPathName = InputBox("Ingrese el nombre de la carpeta que se va a eliminar."). Ingrese el nombre de la carpeta que desea eliminar: ", "Eliminar carpeta")

Si strPathName = "" Entonces salga de Sub

En caso de error, vaya a ErrorHandle

SetAttr strPathName , vbNormal 'Esta línea se utiliza principalmente para comprobar la validez del nombre de la carpeta.

Validez de los nombres de las carpetas

RecurseTree strPathName

Label1.Caption = "Folder" & strPathName & "Deleted!"

Salir de Extr.

Salir de Sub

ErrorHandle:

MsgBox "Nombre de carpeta no válido:" & strPathName

End Sub

Sub RecurseTree(CurrPath As String )

Dim sFileName = "Carpeta" & strPathName

End Sub

Dim sFileName = "Carpeta" & Dim sFileName As String

Dim newPath como cadena

Dim sPath como cadena

OldPath estática como cadena

sPath = CurrPath & "\"

sFileName = Dir(sPath, 31) '31 significa: 31=vbNormal+vbReadOnly+vbHidden+vbSystem+vbVolume+vbDirectory

Hacer mientras sFileName <> """

Si sFileName = CurrPath & "\"

Si sFileName <> "."Y sFileName <> "..."Entonces

Si GetAttr(sPath & sFileName) Y vbDirectory Entonces 'Si directorio y carpeta

newPath = sPath & sFileName

RecurseTree newPath

sFileName = Dir(sPath, 31)

Else

SetAttr sPath & sFileName, vbNormal

Kill (sPath & sFileName)

Label1.Caption = sPath & sFileName 'Mostrar proceso de eliminación

sFileName = Dir

Finalizar si

Else

sFileName = Dir

Finalizar si

DoEvents

Bucle

SetAttr CurrPath, vbNormal

RmDir CurrPath

Label1.Caption = CurrPath

End Sub.