吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2109|回复: 21
收起左侧

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

[复制链接]
linzhisheng 发表于 2025-3-14 23:08
本帖最后由 linzhisheng 于 2025-3-14 23:11 编辑

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


[Bash shell] 纯文本查看 复制代码
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

免费评分

参与人数 3吾爱币 +3 热心值 +3 收起 理由
苏紫方璇 + 3 + 1 欢迎分析讨论交流,吾爱破解论坛有你更精彩!
makaay + 1 谢谢@Thanks!
JackDoe + 1 我很赞同!

查看全部评分

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

tomcat9 发表于 2025-3-14 23:19
这些软件直接不要碰就对了,太lm了
imhanserok 发表于 2025-3-14 23:48
tomcat9 发表于 2025-3-14 23:19
这些软件直接不要碰就对了,太lm了

但是有时候不是说你碰不碰的问题,有时候不知道怎么回事,就装上去了,特别是什么小鸟壁纸,很流氓的感觉
墨羽风 发表于 2025-3-15 00:39
musashi 发表于 2025-3-15 01:57
小鸟壁纸子目前改成画报了
azonna 发表于 2025-3-15 03:36
加注册表里?
faonecze 发表于 2025-3-15 07:39
其实这样的可能是其他软件安装弄的关联下载的吧?安装使用的时候多注意这类软件应该就不会出现的.
matxi 发表于 2025-3-15 08:24
有个东西叫免疫
cq2002 发表于 2025-3-15 08:38
小鸟是不是也是恶心的360全家桶的?
头像被屏蔽
pengziwen 发表于 2025-3-15 09:32
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

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

GMT+8, 2026-9-1 04:20

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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