Skip to content

Instantly share code, notes, and snippets.

@realslacker
Created April 19, 2024 17:05
Show Gist options
  • Save realslacker/1f596adb70e7519b05403845464f19fd to your computer and use it in GitHub Desktop.
Save realslacker/1f596adb70e7519b05403845464f19fd to your computer and use it in GitHub Desktop.
Update Root CA Certificates on Windows 7 - No PowerShell Dependency
@ECHO OFF
SETLOCAL
FOR /F "tokens=4-5 delims=. " %%i IN ('ver') DO SET VERSION=%%i.%%j
IF "%VERSION%" == "10.0" GOTO :NOUPDATE
IF "%VERSION%" == "6.3" GOTO :NOUPDATE
IF "%VERSION%" == "6.2" GOTO :NOUPDATE
IF "%VERSION%" == "6.1" GOTO :UPDATETry
ENDLOCAL
:NOUPDATE
ECHO Current OS not enabled for update.
GOTO :EOF
:UPDATE
ECHO Updating root CA certificates...
bitsadmin /transfer RootCAUpdate http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/authrootstl.cab "%TEMP%\authrootstl.cab"
extrac32.exe /Y /E "%TEMP%\authrootstl.cab" /L "%TEMP%" authroot.stl
certutil.exe -addstore -f root "%TEMP%\authroot.stl"
ECHO Done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment