Created
October 31, 2018 15:30
-
-
Save realslacker/9542667a2546c133bc3756bc0d090e7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
SET mytime=%time: =0% | |
SET dtstamp=%date:~-4%%date:~4,2%%date:~7,2%%mytime:~0,2%%time:~3,2%%time:~6,2% | |
notepad %TEMP%\cert_%dtstamp%.req | |
certreq -submit -attrib "CertificateTemplate:WebServer10Y" %TEMP%\cert_%dtstamp%.req %TEMP%\cert_%dtstamp%.cer | |
notepad %TEMP%\cert_%dtstamp%.cer | |
SET /P answer=Save the generated certificate? (y/N) | |
IF /I "%answer%" EQU "Y" GOTO :movecert | |
IF /I "%answer%" EQU "y" GOTO :movecert | |
GOTO :delete | |
:movecert | |
copy %TEMP%\cert_%dtstamp%.req %userprofile%\Desktop\cert_%dtstamp%\request.req | |
copy %TEMP%\cert_%dtstamp%.cer %userprofile%\Desktop\cert_%dtstamp%\certificate.cer | |
GOTO :done | |
:delete | |
del %TEMP%\cert_%dtstamp%.req /F /Q | |
del %TEMP%\cert_%dtstamp%.cer /F /Q | |
GOTO :done | |
:done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment