# Setting the System Environment Variable

### Overview <a href="#overview" id="overview"></a>

You must renew your subscription by entering a new license key if your subscription has expired and you can no longer access your CodeScan account.

A CodeScan license key can be passed on by setting the path and environment variables in a user's machine.

{% hint style="info" %}
**Note:** Administrator privileges are required to set the system environment variables.
{% endhint %}

### Setting the system environment variables for a Windows operating system <a href="#set-the-system-environment-variables-in-windows-machine" id="set-the-system-environment-variables-in-windows-machine"></a>

#### For Windows 11 <a href="#for-windows-11" id="for-windows-11"></a>

1. Press the **`Windows key+X`** to access the **`Power User Task`** menu.
2. In the **`Power User Task`** menu, select the **`System`** option.
3. In the **`System`** window, scroll to the bottom and click the **`About`** option.
4. In the **`System > About`** window, click the **`Advanced system settings`** link at the bottom of the **`Device specifications`** section.
5. In the **`System Properties`** window, click the **`Advanced`** tab, then click the **`Environment Variables`** button near the bottom of that tab.
6. In the **`Environment Variables`** window, click on **`New`** button in the **`System variables`** section.
7. Enter the following details:
   * **`Variable name`:** **codescanLicense**
   * **`Value:`** **\<License\_Key>**
8. Click **`OK`**.
9. Click **`OK`** again to close the **`Environment Variables`** screen.

#### For Windows 10 <a href="#for-windows-10" id="for-windows-10"></a>

1. Press the **`Windows key+X`** to access the **`Power User Task`** menu.
2. In the **`Power User Task`** menu, select the **`System`** option.
3. In the **`About`** window, click the **`Advanced system settings`** link under **Related settings** on the far-right side.
4. In the **`System Properties`** window, click the **`Advanced`** tab, then click the **`Environment Variables`** button near the bottom of that tab.
5. In the **`Environment Variables`** window, click on **`New`** button in the **`System variables`** section.
6. Enter the following details:
   * **`Variable name`:** **codescanLicense**
   * **`Value:`** **\<License\_Key>**
7. Click **`OK`.**
8. Click **`OK`** again to close the **`Environment Variables`** screen.

### Setting the system environment variables for a Mac operating system <a href="#in-macos" id="in-macos"></a>

System environment variables are added to the `.bash_profile` file:

1. Find the path to **`.bash_profile`** by using:\
   \~/.bash-profile
2. Open the **`.bash_profile`** file with a text editor of your choice.
3. Scroll down to the end of the **`.bash_profile`** file.
4. Use the **`export`** command to add new environment variables:\
   export codescanLicense=\[License\_Key]
5. Save any changes you made to the **`.bash_profile`** file.
6. Execute the new **`.bash_profile`** by either restarting the terminal window or using:\
   source \~/.bash-profile


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://knowledgebase.autorabit.com/product-guides/codescan/codescan-faqs/codescan-self-hosted-issues/setting-the-system-environment-variable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
