sc config sharedaccess start= auto //设置防火墙服务为自动

net start sharedaccess //开启防火墙服务

 

关闭端口

netsh firewall add portopening protocol = TCP port = 139 name = "关闭139" mode = DISABLE

netsh firewall add portopening protocol = TCP port = 445 name = "关闭445" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 137 name = "关闭137" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 138 name = "关闭138" mode = DISABLE 

 

开启端口

netsh firewall add portopening protocol = TCP port = 139 name = "开启139" mode = ENABLE

netsh firewall add portopening protocol = TCP port = 445 name = "开启445" mode =  ENABLE

netsh firewall add portopening protocol = UDP port = 137 name = "开启137" mode =  ENABLE

netsh firewall add portopening protocol = UDP port = 138 name = "开启138" mode =  ENABLE

相关文章:

  • 2022-01-21
  • 2022-12-23
  • 2021-12-27
  • 2021-11-17
  • 2021-12-18
  • 2021-11-23
  • 2022-01-30
猜你喜欢
  • 2022-12-23
  • 2021-12-02
  • 2022-02-22
  • 2021-12-08
  • 2022-03-01
  • 2022-02-09
  • 2021-11-28
相关资源
相似解决方案