@ECHO OFF REM RightNow ID: Task ID: 119428; Ticket ID: 171004-000277 REM REM Description of the issue: REM When installing SafeCom G4 520*10 with "windows authentication" TLS encryption may not work. REM If the TLS certificate is created by the SafeCom Pull or Push Port (running as SYSTEM) REM then the SafeCom Service (running as ) won't be able to use REM that certificate due to insufficient rights, because by default, only the owner and REM the SYSTEM account can access the private key of a certificate. REM REM Workaround: REM Delete the TlsCert registry key and recreate the TLS certificate by SafeCom Service. REM REM Copyright (C) 2018 Nuance Communications, Inc. All rights reserved. REM Administrative permissions required. Detecting permissions... net session >nul 2>&1 IF %ERRORLEVEL% NEQ 0 ( ECHO Not enough permissions. Please run as Administrator! GOTO :error ) REM Stopping SafeCom Service... sc queryex "SafeCom Service" | find "STATE" | find /v "RUNNING" > NUL && GOTO :safecomstopped net stop "SafeCom Service" IF %ERRORLEVEL% NEQ 0 GOTO :error :safecomstopped REM Stopping Spooler... sc queryex "Spooler" | find "STATE" | find /v "RUNNING" > NUL && GOTO :spoolerstopped net stop Spooler IF %ERRORLEVEL% NEQ 0 GOTO :error :spoolerstopped ECHO Deleting TlsCert registry key... reg delete HKEY_LOCAL_MACHINE\SOFTWARE\SafeCom\SafeComG4 /v TlsCert /f IF %ERRORLEVEL% NEQ 0 GOTO :error ECHO. net start "SafeCom Service" IF %ERRORLEVEL% NEQ 0 GOTO :error timeout /t 10 /nobreak >nul net start Spooler ECHO Succeeded GOTO :end :error ECHO Failed :end PAUSE