[Shell] 纯文本查看 复制代码 @echo off
set /p choice=请输入选项(1禁止/2解开):
if "%choice%"=="1" goto :disable
if "%choice%"=="2" goto :enable
echo 无效的选项。
exit /b
:disable
echo 正在尝试禁止软件安装...
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "DisableMSI" /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /t REG_DWORD /d 0 /f
echo 禁止软件安装完成。
pause
exit /b
:enable
echo 正在尝试解开软件安装限制...
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "DisableMSI" /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /f
echo 解开软件安装限制完成。
pause
exit /b
试试这个放到文件夹中另存为BAT |