吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 453|回复: 25
上一主题 下一主题
收起左侧

[其他原创] bat脚本拦截windows某些广告软件

[复制链接]
跳转到指定楼层
楼主
linzhisheng 发表于 2025-3-14 23:08 回帖奖励
本帖最后由 linzhisheng 于 2025-3-14 23:11 编辑

通过windows applocker拦截小鸟壁纸等安装,代码如下,暂时测试通过win11,其它window系统请斟酌而行!建议在虚拟机下测试,真机测试请备份好原注册表


[Bash shell] 纯文本查看 复制代码
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
REM 添加 SrpV2 主键
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2" /f
 
REM 添加 Appx 子键
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Appx" /v AllowWindows /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Appx\a9e18c21-ff8f-43cf-b9fc-db40eed693ba" /v Value /t REG_SZ /d "<FilePublisherRule Id=\"a9e18c21-ff8f-43cf-b9fc-db40eed693ba\" Name=\"(默认规则) 所有签名的封装应用\" Description=\"允许 Everyone 组的成员运行签名的封装应用。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePublisherCondition PublisherName=\"*\" ProductName=\"*\" BinaryName=\"*\"><BinaryVersionRange LowSection=\"0.0.0.0\" HighSection=\"*\"/></FilePublisherCondition></Conditions></FilePublisherRule>" /f
 
REM 添加 Dll 子键
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Dll" /v AllowWindows /t REG_DWORD /d 0 /f
 
REM 添加 Exe 子键
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe" /v EnforcementMode /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe" /v AllowWindows /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\921cc481-6e17-4653-8f75-050b80acca20" /v Value /t REG_SZ /d "<FilePathRule Id=\"921cc481-6e17-4653-8f75-050b80acca20\" Name=\"(默认规则) 位于 Program Files 文件夹中的所有文件\" Description=\"允许 Everyone 组的成员运行位于 Program Files 文件夹中的应用程序。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"%PROGRAMFILES%\\*\"/></Conditions></FilePathRule>" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\a61c8b2c-a319-4cd0-9690-d2177cad7b51" /v Value /t REG_SZ /d "<FilePathRule Id=\"a61c8b2c-a319-4cd0-9690-d2177cad7b51\" Name=\"(默认规则) 位于 Windows 文件夹中的所有文件\" Description=\"允许 Everyone 组的成员运行位于 Windows 文件夹中的应用程序。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"%WINDIR%\\*\"/></Conditions></FilePathRule>" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\b0d54690-5cb5-4a12-8fbe-9073d43db2fa" /v Value /t REG_SZ /d "<FilePathRule Id=\"b0d54690-5cb5-4a12-8fbe-9073d43db2fa\" Name=\"%OSDRIVE%\\vnc\\*\" Description=\"\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"%OSDRIVE%\\vnc\\*\"/></Conditions></FilePathRule>" /f
 
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\fd686d83-a829-4351-8ff4-27c7de5755d2" /v Value /t REG_SZ /d "<FilePathRule Id=\"fd686d83-a829-4351-8ff4-27c7de5755d2\" Name=\"(默认规则) 所有文件\" Description=\"允许本地 Administrators 组的成员运行所有应用程序。\" UserOrGroupSid=\"S-1-5-32-544\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"*\"/></Conditions></FilePathRule>" /f
REM 2345
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\8abea4c0-dea5-41b2-8368-b55d04f40233" /v Value /t REG_SZ /d "<FilePublisherRule Id=\"8abea4c0-dea5-41b2-8368-b55d04f40233\" Name=\"签名人 O=SHANGHAI 2345 MOBILE TECHNOLOGY CO., LTD., S=上海市, C=CN\" Description=\"\" UserOrGroupSid=\"S-1-1-0\" Action=\"Deny\"><Conditions><FilePublisherCondition PublisherName=\"O=SHANGHAI 2345 MOBILE TECHNOLOGY CO., LTD., S=上海市, C=CN\" ProductName=\"*\" BinaryName=\"*\"><BinaryVersionRange LowSection=\"*\" HighSection=\"*\"/></FilePublisherCondition></Conditions></FilePublisherRule>" /f
 
REM 快压
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\21ff9f40-f6b2-4165-9b07-84d26d68569e" /v Value /t REG_SZ /d "<FilePublisherRule Id=\"21ff9f40-f6b2-4165-9b07-84d26d68569e\" Name=\"签名人 O=成都盈畅时代文化传播有限公司, L=成都市, S=四川省, C=CN\" Description=\"\" UserOrGroupSid=\"S-1-1-0\" Action=\"Deny\"><Conditions><FilePublisherCondition PublisherName=\"O=成都盈畅时代文化传播有限公司, L=成都市, S=四川省, C=CN\" ProductName=\"*\" BinaryName=\"*\"><BinaryVersionRange LowSection=\"*\" HighSection=\"*\"/></FilePublisherCondition></Conditions></FilePublisherRule>" /f
 
REM 小鸟壁纸
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\68dad591-3c34-4cf5-b11d-51c2cb310b7c" /v Value /t REG_SZ /d "<FilePublisherRule Id=\"68dad591-3c34-4cf5-b11d-51c2cb310b7c\" Name=\"签名人 O=上海广乐网络科技有限公司, S=上海市, C=CN\" Description=\"\" UserOrGroupSid=\"S-1-1-0\" Action=\"Deny\"><Conditions><FilePublisherCondition PublisherName=\"O=上海广乐网络科技有限公司, S=上海市, C=CN\" ProductName=\"*\" BinaryName=\"*\"><BinaryVersionRange LowSection=\"*\" HighSection=\"*\"/></FilePublisherCondition></Conditions></FilePublisherRule>" /f
 
REM FLASH
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe\873e800f-fa8a-405f-990d-41849bb2152a" /v Value /t REG_SZ /d "<FilePublisherRule Id=\"873e800f-fa8a-405f-990d-41849bb2152a\" Name=\"签名人 O=CHONGQING ZHONGCHENG NETWORK TECHNOLOGY CO. LTD., S=CHONGQING, C=CN\" Description=\"\" UserOrGroupSid=\"S-1-1-0\" Action=\"Deny\"><Conditions><FilePublisherCondition PublisherName=\"O=CHONGQING ZHONGCHENG NETWORK TECHNOLOGY CO. LTD., S=CHONGQING, C=CN\" ProductName=\"*\" BinaryName=\"*\"><BinaryVersionRange LowSection=\"*\" HighSection=\"*\"/></FilePublisherCondition></Conditions></FilePublisherRule>" /f
 
 
 
REM 添加 Msi 子键
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi" /v AllowWindows /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi\5b290184-345a-4453-b184-45305f6d9a54" /v Value /t REG_SZ /d "<FilePathRule Id=\"5b290184-345a-4453-b184-45305f6d9a54\" Name=\"(默认规则) %systemdrive%\\Windows\\Installer 中的所有 Windows Installer 文件\" Description=\"允许 Everyone 组的成员运行位于 %systemdrive%\\Windows\\Installer 中的所有 Windows Installer 文件。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"%WINDIR%\\Installer\\*\"/></Conditions></FilePathRule>" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi\64ad46ff-0d71-4fa0-a30b-3f3d30c5433d" /v Value /t REG_SZ /d "<FilePathRule Id=\"64ad46ff-0d71-4fa0-a30b-3f3d30c5433d\" Name=\"(默认规则) 所有 Windows Installer 文件\" Description=\"允许本地 Administrators 组的成员运行所有 Windows Installer 文件。\" UserOrGroupSid=\"S-1-5-32-544\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"*.*\"/></Conditions></FilePathRule>" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi\b7af7102-efde-4369-8a89-7a6a392d1473" /v Value /t REG_SZ /d "<FilePublisherRule Id=\"b7af7102-efde-4369-8a89-7a6a392d1473\" Name=\"(默认规则) 所有数字签名的 Windows Installer 文件\" Description=\"允许 Everyone 组的成员运行数字签名的 Windows Installer 文件。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePublisherCondition PublisherName=\"*\" ProductName=\"*\" BinaryName=\"*\"><BinaryVersionRange LowSection=\"0.0.0.0\" HighSection=\"*\"/></FilePublisherCondition></Conditions></FilePublisherRule>" /f
 
REM 添加 Script 子键
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script" /v AllowWindows /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script\06dce67b-934c-454f-a263-2515c8796a5d" /v Value /t REG_SZ /d "<FilePathRule Id=\"06dce67b-934c-454f-a263-2515c8796a5d\" Name=\"(默认规则) 位于“程序文件”文件夹中的所有脚本\" Description=\"允许 Everyone 组的成员运行位于 Program Files 文件夹中的脚本。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"%PROGRAMFILES%\\*\"/></Conditions></FilePathRule>" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script\9428c672-5fc3-47f4-808a-a0011f36dd2c" /v Value /t REG_SZ /d "<FilePathRule Id=\"9428c672-5fc3-47f4-808a-a0011f36dd2c\" Name=\"(默认规则) 位于 Windows 文件夹中的所有脚本\" Description=\"允许 Everyone 组的成员运行位于 Windows 文件夹中的脚本。\" UserOrGroupSid=\"S-1-1-0\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"%WINDIR%\\*\"/></Conditions></FilePathRule>" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script\ed97d0cb-15ff-430f-b82c-8d7832957725" /v Value /t REG_SZ /d "<FilePathRule Id=\"ed97d0cb-15ff-430f-b82c-8d7832957725\" Name=\"(默认规则) 所有脚本\" Description=\"允许本地 Administrators 组的成员运行所有脚本。\" UserOrGroupSid=\"S-1-5-32-544\" Action=\"Allow\"><Conditions><FilePathCondition Path=\"*\"/></Conditions></FilePathRule>" /f
 
sc config AppIDSvc start= auto
sc start AppIDSvc
 
REM设置服务自动启动,如出现异常请把2改4运行注册表修改
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AppIDSvc" /v start /t REG_DWORD /d 2 /f
 
gpupdate /force
 
shutdown -r -t 0
pause

免费评分

参与人数 2热心值 +2 收起 理由
makaay + 1 谢谢@Thanks!
JackDoe + 1 我很赞同!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

推荐
bachelor66 发表于 2025-3-15 11:02
这些ID啊什么的是怎么来的呢?                    
推荐
imhanserok 发表于 2025-3-14 23:48
tomcat9 发表于 2025-3-14 23:19
这些软件直接不要碰就对了,太lm了

但是有时候不是说你碰不碰的问题,有时候不知道怎么回事,就装上去了,特别是什么小鸟壁纸,很流氓的感觉
沙发
tomcat9 发表于 2025-3-14 23:19
4#
tcirtsa 发表于 2025-3-14 23:58
imhanserok 发表于 2025-3-14 23:48
但是有时候不是说你碰不碰的问题,有时候不知道怎么回事,就装上去了,特别是什么小鸟壁纸,很流氓的感觉

养成良好的用机习惯才是最重要的捏
5#
yucevip 发表于 2025-3-15 00:39
火绒安全你值得拥有
6#
musashi 发表于 2025-3-15 01:57
小鸟壁纸子目前改成画报了
7#
azonna 发表于 2025-3-15 03:36
加注册表里?
8#
faonecze 发表于 2025-3-15 07:39
其实这样的可能是其他软件安装弄的关联下载的吧?安装使用的时候多注意这类软件应该就不会出现的.
9#
matxi 发表于 2025-3-15 08:24
有个东西叫免疫
10#
wi_xue2008 发表于 2025-3-15 08:36
注册表拦截,谢谢分享
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2025-3-15 20:02

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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