Setting license manager with .bat file and no admin rights (ArcGIS 10.x)

9338
4
08-30-2017 06:12 PM
RebeccaStrauch__GISP
MVP Emeritus

We have multiple license manager servers (different servers) that are kept separate, mainly because the .opt (option) file has never really worked as one would hope.  I'm working on two (DOS .bat) batch files that will allow a user to:

  1. switch between the license levels (Basic and Advanced...we have no Standard). I have this working, although have not tests on a machine without admin rights yet
  2. switch between the license manager servers. It is this 2nd task that I have a question. (again, not tested without admin rights yet)

I'm hoping to get both of these to run without needing admin rights, however that has not yet been tested. But even if admin rights are needed, these scripts should simplify the process.

I have found numerous current_user registry keys that have the value of the license manager:

  • ARCGIS_LICENSE_FILE
  • ESRI_LICENSE_HOST
  • ESRI_LICENSE_SERVER

plus a environmental variables: 

  • ARCGIS_LICENSE_FILE
  • ESRI_LICENSE_HOST

I can get my script to change all of these variables, some may be old/unrelated as my machines have gone thru many versions of the software/LM. 

However, none of these seem to change the License Manager variable in the ArcGIS Administrator dialog box, and that seems to override everything.  I can not seem to find where this is stored, and therefore whether I can overwrite or override it with a script.  I know you can set the value when installing silently (just thought about that) so I think it is possible.  Any suggestions??   

I will post a sample of my scripts when complete...but as always, when messing with registry keeps, be very cautious and use at your own risk.  If something goes wrong, it can mess up a machine.  By the way, I have found and pieced together the pieces of the info needed I needed for the first (and part of the 2nd) script on GeoNet, StackExchange and several MicroSoft related sites.

Tagging vsfoote‌  curtvprice

Current software: 10.2.2 - 10.5.x

Current software license manager: 10.5.1

OS: Windows 7, 64-bit

4 Replies
curtvprice
MVP Esteemed Contributor

However, none of these seem to change the License Manager variable in the ArcGIS Administrator dialog box, and that seems to override everything. 

The recognized reg keys are in HKEY_LOCAL_MACHINE, not HKEY_CURRENT_USER. This is why you need to launch ArcGIS Administrator elevated to modify the keys. The ArcGIS Admin app  box with the server name is not affected by the env variables. (I seem to recall that AA does report in the details listing if the ARCGIS_LICENSE_FILE has been set though.)

Currently active environment variables in my experience do override the registry settings. But if you set the variables in user environment variables and do not log out and in again, they do not "take". This is because if you do this, and launch apps from Windows Explorer, they will use the explorer main shell, which already launched on login and doesn't know about your env variable changes.

The approach I have used is to set up a bat file to launch ArcMap like this. What's nice about this approach is the env variable tweaks only apply to the ArcMap session and the user's default settings are unmodified for the 'normal' future ArcMap launch. After the session is over, and the users opens arcmap in the normal way, it will use what the desktop has been wired to. So you could set people up for Viewer and have them run the script for sessions where they need Professional (ArcInfo), and they don't have to remember to run a script or set a variable to set it back. This way your limited arcinfo licenses will be easier to keep available.

:: usage: arcz {server} {VIEWER|EDITOR|PROFESSIONAL} {ARCMAP|ARCCATALOG|ARCSCENE|ARCGLOBE}
@echo off
setlocal
set server=%1
set class=%2
set app=%3
:: set defaults if not provided
if "%server%"=="" set server=27004@your_default_server
if "%server%"=="#" set server=27004@your_default_server
if "%class%"=="" set class=PROFESSIONAL
if "%class%"=="#" set class=PROFESSIONAL
if "%app%"=="" set app=arcmap
:: set up environment and launch application
set ARCGIS_LICENSE_FILE=%server%
set ESRI_SOFTWARE_CLASS=%class%
:: report values
set arcgis
set esri
echo Starting %app%.exe ...
start /d "%AGSDESKTOPJAVA%bin" /b %app%.exe
pause‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

How To: Change the ArcGIS Desktop seat type for Citrix or restricted permissions environments 

RebeccaStrauch__GISP
MVP Emeritus

Thanks Curtis.  I was wondering if it was a current user vs.  local machine issue. It's actually interesting that really the only time it really doesn't work for me is when the license level wasn't available (i.e. advanced) on the chosen LM, so in that situation it choose the value in the Desktop Administrator.

The reason I am going with my approach v's a startup script is there are many combinations, but usually once set, they don't change for a while. That is, the level may change often (AV to AI back to AV) but the license manager doesn't...only when the user needs to borrow a license (limited number of licenses available) or for power users or IT providing tech support/testing.

Ill take a closer look at you blog post and code more in the morning.  Maybe I can still make that flexible for out use (i.e., the others prompt the user for their selection).  Thanks for the info!

0 Kudos
JeremiahPoling
New Contributor II

Curtis,

This works beautifully, Thanks!

We're using single use desktop basic licenses, and a shared standard license, so the only change we had to make for our use was to add a line to switch from a single use "Fixed" seat type to the "Float" seat type:

:: usage: arcz {server} {VIEWER|EDITOR|PROFESSIONAL} {ARCMAP|ARCCATALOG|ARCSCENE|ARCGLOBE}
@echo off
setlocal
set server=%1
set class=%2
set app=%3
:: set defaults if not provided
if "%server%"=="" set server=27004@yourdefaultserver
if "%server%"=="#" set server=27004@yourdefaultserver
if "%class%"=="" set class=Editor
if "%class%"=="#" set class=Editor
if "%app%"=="" set app=arcmap
:: set up environment and launch application
set ESRI_SEAT_PREFERENCE=Float
set ARCGIS_LICENSE_FILE=%server%
set ESRI_SOFTWARE_CLASS=%class%
:: report values
set arcgis
set esri
echo Starting %app%.exe ...
start /d "%AGSDESKTOPJAVA%bin" /b %app%.exe
REM pause‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
RebeccaStrauch__GISP
MVP Emeritus

I was able to write a bat file that works.  I have posted it https://community.esri.com/docs/DOC-10751-change-arcgis-desktop-license-level-and-lm-machines-wo-adm...  and will close this thread.