无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 3252|回复: 23
打印 上一主题 下一主题

[已解决] 有没有哪个大神帮忙写个在文件夹上右键,断网和恢复联网文件夹下所以exe文件的程序?

[复制链接]
1#
发表于 2023-9-26 10:56:03 | 显示全部楼层
这是论坛里面人家发的批处理里面找到的!

  1. @echo off

  2. ::为.exe程序快捷添加防火墙规则
  3. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules" /f /v "MUIVerb" /t REG_SZ /d "防火墙规则"
  4. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules" /f /v "Icon" /t REG_SZ /d "FirewallControlPanel.dll,0"
  5. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules" /f /v "SubCommands" /t REG_SZ /d ""
  6. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item0" /f /v "MUIVerb" /t REG_SZ /d "禁止入站"
  7. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item0" /f /v "Icon" /t REG_SZ /d "imageres.dll,-105"
  8. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item0\Command" /f /ve /t REG_SZ /d "mshta vbscript:createobject("shell.application").shellexecute("netsh.exe","advfirewall firewall add rule name = ""%%1"" dir = in program = ""%%1"" action = block","","runas",0)(close)"
  9. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item1" /f /v "MUIVerb" /t REG_SZ /d "禁止出站"
  10. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item1" /f /v "Icon" /t REG_SZ /d "imageres.dll,-105"
  11. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item1\Command" /f /ve /t REG_SZ /d "mshta vbscript:createobject("shell.application").shellexecute("netsh.exe","advfirewall firewall add rule name = ""%%1"" dir = out program = ""%%1"" action = block","","runas",0)(close)"
  12. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item2" /f /v "MUIVerb" /t REG_SZ /d "允许入站"
  13. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item2" /f /v "Icon" /t REG_SZ /d "imageres.dll,-106"
  14. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item2\Command" /f /ve /t REG_SZ /d "mshta vbscript:createobject("shell.application").shellexecute("netsh.exe","advfirewall firewall delete rule name = ""%%1"" dir = in program = ""%%1""","","runas",0)(close)"
  15. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item3" /f /v "MUIVerb" /t REG_SZ /d "允许出站"
  16. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item3" /f /v "Icon" /t REG_SZ /d "imageres.dll,-106"
  17. reg add "HKCR\SystemFileAssociations\.exe\shell\FirewallRules\Shell\Item3\Command" /f /ve /t REG_SZ /d "mshta vbscript:createobject("shell.application").shellexecute("netsh.exe","advfirewall firewall delete rule name = ""%%1"" dir = out program = ""%%1""","","runas",0)(close)"
  18. reg add "HKCR\DesktopBackground\shell\Item0\shell\Item5" /f /v "MUIVerb" /t REG_SZ /d "防火墙规则"
复制代码

点评

不要乱用自己不懂的代码,怕夹带私货  发表于 2023-10-25 15:17
[attachimg]532562[/attachimg] 我用了你这个批处理后,显示乱码,在文件夹的右键菜单不会显示,只在EXE文件右键菜单才会显示  详情 回复 发表于 2023-9-30 13:42
谢谢  详情 回复 发表于 2023-9-26 18:26
回复

使用道具 举报

2#
发表于 2023-9-30 14:24:07 | 显示全部楼层
本帖最后由 fulibo 于 2023-9-30 14:25 编辑
9chengwo 发表于 2023-9-30 13:42
我用了你这个批处理后,显示乱码,在文件夹的右键菜单不会显示,只在EXE文件右键菜单才会显示

ANSI格式!

2023-09-30_14-25-28.png (124.28 KB, 下载次数: 67)

2023-09-30_14-25-28.png

点评

我改了格式,现在不会乱码了,但是我把某个EXE文件用这个禁止入站和禁止出站,为啥在防火墙规则设置里面看不到新建的规则呢?似乎这些命令没有起作用啊  详情 回复 发表于 2023-10-1 09:15
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-5-12 07:17

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表