[英]Firewall start/stop using win32 api for windows XP os
I am trying to start and stop the firewall in Windows XP using the win32 api for changing settings in the registry, ie HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile
. 我正在尝试使用Win32 API在Windows XP中启动和停止防火墙,以更改注册表中的设置,即
HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile
。 I am trying to change a data value but it's not changing. 我正在尝试更改数据值,但它没有改变。 So can tell me any other way how I can stop the firewall in windows XP?
那么可以告诉我其他方法如何停止Windows XP中的防火墙吗?
Why are you stopping the firewall? 为什么要停止防火墙? Did you check this article from codeproject which uses another method?
您是否从使用其他方法的codeproject中检查了这篇文章?
Edit: Got this from here . 编辑:从这里得到了 。
There are several solutions available to disable the firewall programmatically without extracting the SP2 EXE file. 有几种解决方案可通过编程方式禁用防火墙,而无需提取SP2 EXE文件。
Here are two ways: 有两种方法:
1) Adding the registry values mentioned, this can be done either before or after SP2 is installed 1)添加提到的注册表值,可以在安装SP2之前或之后完成
The registry key path has changed since I posted that post (it is now WindowsFirewall instead of FirewallPolicy): 自从我发布该帖子以来,注册表项路径已更改(现在是WindowsFirewall而不是FirewallPolicy):
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile
\EnableFirewall=0 (DWORD data type)
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\StandardProfile
\EnableFirewall=0 (DWORD data type)
If you want to disable the service as well: 如果还要禁用该服务:
sc.exe config SharedAccess start= disabled sc.exe配置SharedAccess开始=禁用
2)The following command line will disable SP2's firewall (must be run after SP2 is installed and at least one reboot is done): 2)以下命令行将禁用SP2的防火墙(必须在安装SP2并完成至少一次重新引导后运行):
netsh.exe firewall set opmode mode=disable profile=all
What service pack are you running? 您正在运行什么Service Pack? Microsoft likes to relocate these keys ... ;-)
Microsoft喜欢重新定位这些键... ;-)
Check 校验
HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\DomainProfile\\EnableFirewall=0
(DWORD data type) HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\DomainProfile\\EnableFirewall=0
(DWORD数据类型)
and 和
HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\StandardProfile\\EnableFirewall=0
(DWORD data type) HKEY_LOCAL_MACHINE\\SOFTWARE\\Policies\\Microsoft\\WindowsFirewall\\StandardProfile\\EnableFirewall=0
(DWORD数据类型)
Stopping the service would be best though ;-) 最好停止服务;-)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.