@echo off rem Check command-line syntax. A path w/o quotes will probably put values into %2 if "%~1"=="" goto syntax if NOT "%~2"=="" goto syntax if NOT exist "%1\sshd_messages.dll" goto not_present reg query "HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Application\sshd" > NUL 2> NUL if errorlevel 1 goto continue_install echo The registry key: echo. echo HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Application\sshd echo. echo is already present. This may indicate that an event message file for sshd echo is already installed. Please review the contents of the registry path above. goto end :continue_install reg add "HKLM\SYSTEM\CurrentControlSet\Services\Eventlog\Application\sshd" /v EventMessageFile /t REG_SZ /d "%~f1\sshd_messages.dll" > NUL 2> NUL echo Installed event message file registry entry successfully. goto end :not_present echo The sshd_messages.dll file is not present in path specified. Please echo double-check the path and try again. goto end :syntax echo Syntax: register_sshd_messages.cmd (folder containing sshd_messages.dll) echo. echo Please be sure to enclose any paths containing spaces with double-quotes ("). echo Please specify only the name of the folder containing the sshd_messages.dll echo file, and not the filename of the DLL file itself. :end echo.