删除Windows 10事件日志evtx

2024-05-15 23:13:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图创建一个脚本来删除Windows10x64事件日志。我做不到,所以我试图用“1”覆盖它的大小。日志的路径是C:\Windows\System32\winevt\Logs。在

我有这个方法覆盖文件,但它似乎没有在这样的目录。在

方法:

def bytesOverwrite(filepath):
multiplier = extra.getSize(filepath)
with open(filepath, "w") as text_file:
     text_file.write(multiplier * "1")

路径:

^{pr2}$

错误:

WindowsError: [Error 3] The system cannot find the path specified: 'C:\\Windows\\System32\\winevt\\Logs\\Microsoft-Windows-Deduplication%4Diagnostic.evtx'

是否有其他方法或库来编辑或删除evtx文件?在


Tags: 方法text路径脚本windows事件filelogs