SOLVED. I would like to share my current DOS script which works:
@echo off
set folder=%~dp0
if #%folder:~-1%# == #\# set folder=%folder:~0,-1%
rd /s /q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\SAS\Utilities"
rd /s /q "%appdata%\Microsoft\Windows\Start Menu\Programs\SAS"
md "%appdata%\SAS\MetadataServerProfiles"
xcopy /e /y /r %folder%\config\*.swa "%appdata%\SAS\MetadataServerProfiles\"
echo install certificates
rem C:\Program Files\SASHome\SASSecurityCertificateFramework\1.1\cacerts
for /f "tokens=*" %%i in ('dir /b "%folder%\CI Certficates\"') do set cert=%%i && call :add_cert %cert%
pause
exit
:add_cert
echo cert %cert%
call :create_rspfile %cert%
"C:\Program Files\SASHome\SASDeploymentManager\9.4\sasdm.exe" -quiet -responsefile "%temp%\cert.rsp"
goto :eof
:create_rspfile
rem create response file
set rspfilelocation=%folder%\CI Certficates\%cert%
echo MANAGE_TASK=certframe_add > "%temp%\cert.rsp"
echo certframe.add.file=%rspfilelocation% >> "%temp%\cert.rsp"
goto :eof