void deleteHistory() {
const char *path = "C:\\Windows\\History\\*"; // Ruta del historial
WIN32_FIND_DATA findFileData;
HANDLE hFind = FindFirstFile(path, &findFileData);
if (hFind == INVALID_HANDLE_VALUE) {
printf("No se pudo acceder al directorio de historial.\n");
return;
}
do {
// Construir la ruta completa del archivo
char fullPath[MAX_PATH];
snprintf(fullPath, sizeof(fullPath), "C:\\Windows\\History\\%s", findFileData.cFileName);
// Eliminar el archivo
if (DeleteFile(fullPath)) {
printf("Archivo eliminado: %s\n", fullPath);
} else {
printf("Error al eliminar el archivo: %s\n", fullPath);
}
} while (FindNextFile(hFind, &findFileData) != 0);
FindClose(hFind);
}