win7 win10 静默安装受信任根数字证书 bat
@echo off
REM ________________________________________________________________
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
echo ...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\g.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\g.vbs"
"%temp%\g.vbs"
exit /B
:gotAdmin
certutil.exe -addstore -f "Root" "C:\Users\dell\Desktop\v2\test.cer
exit