diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-06 22:22:41 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-05-06 22:22:41 +0300 |
commit | 116d1ede0cc0d5d57f593264251668531252c74b (patch) | |
tree | ab4618829e4ab95e231e059133b8b7d1533ab6c2 /add_cert.bat | |
download | windows7-drivers-116d1ede0cc0d5d57f593264251668531252c74b.tar.gz windows7-drivers-116d1ede0cc0d5d57f593264251668531252c74b.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | add_cert.bat | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/add_cert.bat b/add_cert.bat new file mode 100644 index 0000000..90f851c --- /dev/null +++ b/add_cert.bat @@ -0,0 +1,24 @@ +@setlocal enabledelayedexpansion +@echo off + +set cert_store=Test Certificate Store +set cert_name=Test Certificate + +echo ============================ CERT INFO ============================ +echo Certificate store: "%cert_store%" +echo Certificate name: "%cert_name%" +echo ========================== END CERT INFO ========================== +echo. +echo ======================= ADDING CERTIFICATE ======================== +echo makecert.exe -$ individual -r -pe -ss "%cert_store%" -n CN="%cert_name%" "%cert_name%.cer" +makecert.exe -$ individual -r -pe -ss "%cert_store%" -n CN="%cert_name%" "%cert_name%.cer" >nul || goto :add_cert_failure +echo certmgr.exe /add "%cert_name%.cer" /s /r localMachine root +certmgr.exe /add "%cert_name%.cer" /s /r localMachine root >nul || goto :add_cert_failure +echo del "%cert_name%.cer" +del "%cert_name%.cer" >nul || goto :add_cert_failure +echo =================== ADDING CERTIFICATE SUCCESS ==================== +exit /b 0 + +:add_cert_failure +echo =================== ADDING CERTIFICATE FAILURE ==================== +exit /b %errorlevel% |