2014-09-29 71 views

回答

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) 
0

有兩種類型的Windows防火牆日誌記錄選項,你必須改變他們分開。
您可以通過使用以下命令禁用(並啓用當然)日誌上的所有配置文件:

netsh advfirewall set allprofiles logging droppedconnections disable 
netsh advfirewall set allprofiles logging allowedconnections disable 

你是絕對正確的。命令行幫手和官方文檔都不足。
我能找到證明命令用法的唯一官方文檔是:http://msdn.microsoft.com/en-us/library/windows/desktop/bb736284%28v=vs.85%29.aspx

希望它有幫助。