2014-02-07 2 views
4

나는 예외 목록에 소프트웨어 "example.exe"를 추가하려면이 코드를 사용하고 있습니다 :고급 방화벽 예외

netsh advfirewall firewall add rule action=allow profile=any protocol=any enable=yes direction=in name=example_in program = "C:\\Program Files\\example.exe" > NUL 
netsh advfirewall firewall add rule action=allow profile=any protocol=any enable=yes direction=out name=example_out program = "C:\\Program Files\\example.exe" > NUL 

을 나는 "에서 | 아웃"할 수있는 방법의 일부 하나의 유일한 라인?

내 말은 같은 것을 : 당신은 같은 quicky 배치 파일을 사용하여이 작업을 수행 할 수

netsh advfirewall firewall add rule action=allow profile=any protocol=any enable=yes direction=any name=example_in program = "C:\\Program Files\\example.exe" > NUL 

답변

4

:

for %%x in (in out) do (
    netsh advfirewall firewall add rule action=allow profile=any protocol=any enable=yes direction=%%x name=example_%%x program = "C:\\Program Files\\example.exe" > NUL 
) 
+0

덕분에,이 좋은,하지만 정말 어떤 "어떤을"존재하지 않는 방향성 주장을 위해서? : S – user3108594

+1

도움에 따르면, 아니요 : 'netsh advfirewall firewall add rule? ' – Mark