@echo off rem see http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx set _OS_X64= rem Specify the location of a log file to keep a record of the result. Specify a shared location to collect the results from multiple machines in a single file. set _LogFile=%temp%\BentleyComplianceLog.csv if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (SET _OS_X64=1) if "%PROCESSOR_ARCHITEW6432%"=="AMD64" (SET _OS_X64=1) if not defined _OS_X64 (goto 32bit) :64bit set _LicenseToolLocation=%ProgramFiles(x86)%\Bentley\MicroStation V8i (SELECTseries)\MicroStation goto ToolCheck :32bit set _LicenseToolLocation=%ProgramFiles%\Bentley\MicroStation V8i (SELECTseries)\MicroStation :ToolCheck if not exist "%_LicenseToolLocation%\LicenseToolCmd.exe" ( echo %UserName%,%ComputerName%,%date%,%time%,failed>> "%_LogFile%" echo ERROR: License settings could not be updated. echo LicenseToolCmd.exe cannot be found. echo Aborting... pause exit /B 1 ) rem Specify SELECTserver license settings below. set _ServerName=selectserver.bentley.com set _SiteKey=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA rem Specify proxy settings below if applicable. rem The _ProxyServer variable can be set by itself if authentication is not required. rem Otherwise all three variables must be defined. set _ProxyServer= set _ProxyUser= set _ProxyPassword= "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:SELECTServer -value:%_ServerName% >NUL 2>NUL "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:ActivationKey -value:%_SiteKey% >NUL 2>NUL if not defined _ProxyServer goto DisableProxy "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:UseProxy -value:Yes >NUL 2>NUL "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:ProxyServer -value:%_ProxyServer% >NUL 2>NUL if not defined _ProxyUser goto DisableProxyAuth "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:ProxyNeedsAuth -value:Yes >NUL 2>NUL "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:ProxyUser -value:%_ProxyUser% >NUL 2>NUL "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:ProxyPassword -value:%_ProxyPassword% >NUL 2>NUL goto LogResult :DisableProxy "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:UseProxy -value:No >NUL 2>NUL goto LogResult :DisableProxyAuth "%_LicenseToolLocation%\LicenseToolCmd.exe" configure -setting:ProxyNeedsAuth -value:No >NUL 2>NUL :LogResult echo %UserName%,%ComputerName%,%date%,%time%,success>> "%_LogFile%"
ウィンドウスのグループポリシーはSELECTServer認証方式でIT管理者が一括でライセンス情報を複数の端末に設定する効率的な方法ですが、
このWikiでは、バッチファイルでライセンス情報をレジストリに書込む方法を紹介します。
重要:バッチファイルを実行する前に、必ず以下の手順に従って、プレースホルダのテキストを本番環境情報に置換えてください。
管理者権限でバッチファイルを実行してください。バッチファイルをクリックすると、コマンドプロンプトは一瞬に立上り、処理が数秒で済み、そして、コマンドプロンプトのウィンドは自動的に消えます。
重要:念のため、バッチファイルを実行した後に、ライセンス管理ツールを開き、ライセンス情報は正しく設定されているのかを確認ください。