Use LM_LICENSE_FILE variable:

If you turn on this option, the Intel® Quartus® Prime software uses the LM_LICENSE_FILE environment variable to find the license file, and disables License Setup dialog box.

Note: By default, the license file setting in the License Setup dialog box supersedes the LM_LICENSE_FILE or ALTERAD_LICENSE_FILE environment variable setting.

To update the LM_LICENSE_FILE variable you must close the Intel® Quartus® Prime software.

The syntax of the LM_LICENSE_FILE variable must follow the same rules than the License file dialog box.