windows 7 - Using SETX to configure a pc's LM_LICENSE_FILE environment variable

  • user235256

    Various Windows applications such as Matlab, Altair, Nastran etc use license servers, which require a system environment variable - LM_LICENSE_FILE, to be updated which would take a value along the lines of: %MSC_LICENSE_FILE%;%MATLAB_LICENSE_FILE%;%ALTAIR_LM_LICENSE_FILE% (if these 3 apps were installed).

    Setting the variable for the individual apps using SETX is easy:


    But how would I set the LM_LICENSE_FILE variable to reflect the apps installed on a pc that reference this variable using a .cmd file? Ideally it would query the pc to see what apps (apps that use LM_LICENSE_FILE environment variables) are installed, set the individual app system environment variable and then set the correct LM_LICENSE_VARIABLE value.

    Regards and thanks in advance

  • Answers
  • Karan

    You can use something like wmic product get name,version in your batch file to list installed programs, but this doesn't generate a comprehensive list. So in addition to wmic you can make your batch file query known program installation locations in the registry (for example HKCU\Software, HKLM\Software, HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall, HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall etc.) using the reg command.

    Once you've built up a list of installed programs your batch file can then add the required environment variables with the proper values.

  • Related Question

    windows 7 - What is the purpose of the environment variable asl.log?
  • Cheeso

    I run Windows 7.

    I notice that there's an environment variable called asl.log. What is this thing? Who puts it there?

    What's the purpose of it?

    I searched and found only references to MacOS and Apple System Log.
    But as I said, this is a Windows7 machine from Dell. It doesn't run MacOS.

  • Related Answers
  • Permutor

    I have it too in W7. A SYSTEM environment variable asl.log with the value Destination=file

    Found this reference in the register: HKEY_CURRENT_USER\Software\Apple Inc.\ASL\filenames\asl.log value REG_SZ asl.103843_28May11.log

    I am pretty sure it is an Apple thing.