newswan 当前离线
上尉
New-NetFirewallRule -DisplayName "aaa" -Program "notepad.exe" -Action Allow do { Enable-NetFirewallRule -DisplayName "aaa" start-sleep 5 disable-NetFirewallRule -DisplayName "aaa" start-sleep 8 } while {$true}复制代码
TOP
netsh advfirewall set domainprofile firewallpolicy blockinbound,AllowOutbound netsh advfirewall set privateprofile firewallpolicy blockinbound,AllowOutbound netsh advfirewall set publicprofile firewallpolicy blockinbound,AllowOutbound复制代码
$program = "D:\program files\mobaxterm\root\slash\bin\xwin_mobax.exe" New-NetFirewallRule -DisplayName "bbb" -Profile Private,Public -Direction Outbound -Program $program -Action block $count = 0 do { $count += 1 write-host "count:" $count Enable-NetFirewallRule -DisplayName "bbb" start-sleep 5 disable-NetFirewallRule -DisplayName "bbb" start-sleep 8 } while {$true}复制代码
@powershell -c "Get-Content '%~0' | Select-Object -Skip 1 | Out-String | Invoke-Expression" & pause & exit复制代码
set %program%="D:\Program Files\realVNC\VNC-Viewer.exe" netsh advfirewall firewall add rule name="bbb" profile=public,private dir=out program=%program% action=block set count=0 :Loop set /a count+=1 echo count: %count% netsh advfirewall firewall set rule name="bbb" new enable=no choice /t 5 /d y /n >nul netsh advfirewall firewall set rule name="bbb" new enable=yes choice /t 8 /d y /n >nul goto :Loop复制代码
while ($true)复制代码
while {$true}复制代码