0

相当于:

netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\Firewall\pfirewall.log

在 C/C++ 和 VBScript 中?

我在官方中一无所获:具有高级安全接口的 Windows 防火墙

注意:我只对启用/禁用日志记录感兴趣,而不是更改日志文件名。

4

1 回答 1

0

不了解 C/C++,但在 VBScript 中,您只需运行netsh命令行:

logfile = "%systemroot%\system32\LogFiles\Firewall\pfirewall.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)
于 2014-09-29T13:09:56.443 回答