Create a new txt file with any file name
Copy the following code to the file
@echo off
rem 获取管理员权限
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~n0 ::","","runas",1)(window.close)&&exit
rem 开始将广告dll设置为只读
for /f "tokens=1* delims==" %%a in ('ftype Tencent') do (
set QQFilePath=%%~dpbQQ.exe
)
set RepalceStr=Plugin\Com.Tencent.Advertisement\Bin\Advertisement.dll
call set DllPath=%QQFilePath:Bin\QQ.exe=%%RepalceStr%%
echo %DllPath%
attrib +r "%DllPath%"
pause
Then change the file name suffix from .txt to .bat, and double-click to run it.
This method can be applied to advertisements of other software, provided that you can find out which dll it is.