@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%"