# Check if running under Continua

**URL:** https://www.finalbuilder.com/forums/t/check-if-running-under-continua/7325
**Category:** Discussion
**Created:** [February 2, 2023, 10:28am UTC](https://www.finalbuilder.com/forums/t/check-if-running-under-continua/7325 "2023-02-02T10:28:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![k3tchup](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/k3tchup/32/2162_2.png) [@k3tchup](https://www.finalbuilder.com/forums/u/k3tchup)
#### Post date: [February 2, 2023, 10:28am UTC](https://www.finalbuilder.com/forums/t/check-if-running-under-continua/7325/1 "2023-02-02T10:28:21Z")

</div>

Is there a way to determine if the environment is ran under Continua ? Like a environmental variable ?  
I would like my script to behave differently when ran locally and when on Continua.  
As of now I use my own environmental variable, but maybe there is a better way ?

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [February 3, 2023, 1:09am UTC](https://www.finalbuilder.com/forums/t/check-if-running-under-continua/7325/2 "2023-02-03T01:09:52Z")

</div>

Hi Michal,

All the actions that run command lines have an option under the `Environment` tab to “generate system environment variables”. This sets up several environment variables related to the build with the prefix `ContinuaCI`. You can list them all using the `Run DOS Command / Batch File` action with the Command “`set ContinuaCI`”. We recommend testing for the existence of the `ContinuaCI.Version` environment variable.

Alternatively, several actions which run programs or scripts (`Powershell`, `Execute Program`, `Run DOS Command / Batch File`) have an option to “generate a context XML file”. This saves an XML file to the workspace containing the same build details and more. The `FinalBuilder` action also always generates this file (without option). You can therefore test for the existence of the file: `$Workspace$\ContinuaContext.xml`. This is what the FinalBuilder `If Running Under Continua` action does.

If you prefer not to change any action options, you can test for the existence of the file `$Workspace\__variable\VariableNamespaces.xml`. All builds generate this file which contains details of all variables available to the build at the start of each stage .
