0

Which is the equivalent of:

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

in C/C++ and VBScript ?

I found nothing in official: Windows Firewall with Advanced Security Interfaces

Note: I am interested only in enabling/disabling logging, not in changing the log filename.

antonio
  • 10,629
  • 13
  • 68
  • 136

1 Answers1

0

Don't know about C/C++, but in VBScript you'd simply shell out to run the netsh commandline:

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)
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328