用SB(SandBoxie)限制QQ资源访问

上面截图可以看到,此脚本我很早就已经创建了;只不过之前是偶尔使用,最近又改了下,长期使用了下,没什么问题就拿出来分享了。

其内容如下:

@Echo Off
Title SandBoxie-QQ                                       __Create by [email protected]/08/08
Setlocal Enabledelayedexpansion
Color 0B
::Please Confirm the configure under line.
::<---------------------Configure Start.--------------------->
Set SB_Path="C:\Program Files\Sandboxie"
Set Pre_QQ="C:\Program Files (x86)\Common Files\Tencent\QQProtect\Bin\QQProtect.exe"
Set QQ="C:\Program Files (x86)\Tencent\QQ\Bin\QQ.exe"
Set QQ=%QQ:"=%
REM Modify it, If your PC is to slow.
Set Wait_Start=10
::<---------------------Configure End.----------------------->
::<--------------------------------------------------------------------------------------------------->
Echo %RANDOM% > %windir%\Power.pw
If Not Exist %windir%\Power.pw  (
            Echo No Power to Run ,Goto "Run As Administrator"!
            Goto UACPrompt
            )
Call :GotAdmin
Del /f /q  %windir%\Power.pw > Nul 2>&1
::<--------------------------------------------------------------------------------------------------->
Echo Enable QPCore Temporary.
Sc config QPCore start=demand
Echo.
Echo Start QQ In SandBox.
Start /D %SB_Path% Start.exe /box:QQ %Pre_QQ%
Start /D %SB_Path% Start.exe /box:QQ %QQ%
Echo.
Echo Wait %Wait_Start% Seconds To Start SB_QQ.
ping 1.1.1.1 /w 1000 /n %Wait_Start% > Nul 2>&1
Echo.
Echo Disable QPCore Temporal.
Sc config QPCore start=disabled
Echo Kill QPCore Service Process.
Taskkill /F /FI "SESSION eq 0" /IM QQProtect.exe
Echo.
Echo Operation Complete.
Echo This Window Will Be Closed in 5 Seconds.
Ping 1.1.1.1 /w 1000 /n 4 > Nul 2>&1
Exit
::<--------------------------------------------------------------------------------------------------->
:UACPrompt
Echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
Echo UAC.ShellExecute "%~f0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
Exit
:GotAdmin
If exist "%temp%\getadmin.vbs" ( del /f /q "%temp%\getadmin.vbs"  )
Cd /d "%~dp0"
Goto :Eof
::<--------------------------------------------------------------------------------------------------->

将其复制保存到.bat文件中,运行即可。上面Wait_Start中的数字可以按自己PC运行速度来更改。

《用SB(SandBoxie)限制QQ资源访问》有8条评论

  1. 博主你好, 尝试用您的方法安装 9.4.0 时提示 “无法定位程序输入点o_cexit于动态链接库C:Windows\System32\msvcp_win.dll 上。”有没有办法解决呢

发表评论

error: Content is protected !!