@echo off @echo 請以管理員身份運行 set /p portRemark=請輸入端口備註: set /p port=請輸入端口號: powershell -command "New-NetFirewallRule -DisplayName '%portRemark%' -Direction Inbound -Action Allow -RemoteAddress Any -Protocol TCP -LocalPort %port%" pause