这相当于:
netsh advfirewall set currentprofile logging filename %systemroot%system32LogFilesFirewallpfirewall.log
在C/C++和VBScript中?
我在官方网站上没有发现任何东西:具有高级安全接口的Windows防火墙
注:我只对启用/禁用日志记录感兴趣,而对更改日志文件名不感兴趣。
不知道C/C++,但在VBScript中,您只需执行netsh
命令行:
logfile = "%systemroot%system32LogFilesFirewallpfirewall.log"
Function qq(str) : qq = Chr(34) & str & Chr(34) : End Function
Set sh = CreateObject("WScript.Shell")
sh.Run "netsh advfirewall set currentprofile logging filename " & qq(logfile)